正文
增加 11 行删除 11 行
14 行未改动1516171819202122232425262728293031323334353637383940414243442 行未改动14 行未改动## 代码```cpp//考场代码#include<bits/stdc++.h>#define int long long //一定要开,不然1e5*1e5会炸using namespace std;map<int,int> mp; //我也不知道为什么开了map//int mp[100001];signed main(){ios::sync_with_stdio(0); //读优输优cin.tie(0),cout.tie(0);int n,m,ans=0; //主函数内要初始化为0cin>>n>>m;for(int i=1; i<=m; i++){int a,b;cin>>a>>b;ans+=mp[a]; //先加上之前的ans+=mp[b];mp[a]++; //再自增mp[b]++;}cout<<ans<<'\n';return 0;}```2 行未改动14 行未改动1516171819202122232425262728293031323334353637383940414243442 行未改动14 行未改动## 代码```cpp//考场代码#include<bits/stdc++.h>#define int long long //一定要开,不然1e5*1e5会炸using namespace std;map<int,int> mp; //我也不知道为什么开了map//int mp[100001];signed main(){ios::sync_with_stdio(0); //读优输优cin.tie(0),cout.tie(0);int n,m,ans=0; //主函数内要初始化为0cin>>n>>m;for(int i=1; i<=m; i++){int a,b;cin>>a>>b;ans+=mp[a]; //先加上之前的ans+=mp[b];mp[a]++; //再自增mp[b]++;}cout<<ans<<'\n';return 0;}```2 行未改动