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