#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
std::vector<std::pair<int,int>> Alice();
long long setN(int n);
long long Bob(std::vector<std::pair<int,int>> V);
const ll nodes=5000;
std::vector<std::pair<int,int>> Alice(){
long long x = setN(nodes);
std::vector<std::pair<int,int>> r={};
for(int i=1;i<=nodes;i++)if(x!=i)r.push_back({x,i});
return r;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
std::vector<std::pair<int,int>> Alice();
long long setN(int n);
long long Bob(std::vector<std::pair<int,int>> V);
long long Bob(std::vector<std::pair<int,int>> V){
map<ll,ll> mp;
for(int i=0;i<V.size();i++){
mp[V[i].first]++;mp[V[i].second]++;
if(mp[V[i].first]==2)return V[i].first;
if(mp[V[i].second]==2)return V[i].second;
}
return 0;
}
Compilation message
Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:11:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
11 | for(int i=0;i<V.size();i++){
| ~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
824 KB |
Correct. |
3 |
Correct |
1 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
2 ms |
816 KB |
Correct. |
6 |
Correct |
1 ms |
820 KB |
Correct. |
7 |
Correct |
2 ms |
832 KB |
Correct. |
8 |
Correct |
2 ms |
824 KB |
Correct. |
9 |
Correct |
2 ms |
820 KB |
Correct. |
10 |
Correct |
2 ms |
820 KB |
Correct. |
11 |
Correct |
2 ms |
820 KB |
Correct. |
12 |
Correct |
2 ms |
812 KB |
Correct. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
824 KB |
Correct. |
3 |
Correct |
1 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
2 ms |
816 KB |
Correct. |
6 |
Correct |
1 ms |
820 KB |
Correct. |
7 |
Correct |
2 ms |
832 KB |
Correct. |
8 |
Correct |
2 ms |
824 KB |
Correct. |
9 |
Correct |
2 ms |
820 KB |
Correct. |
10 |
Correct |
2 ms |
820 KB |
Correct. |
11 |
Correct |
2 ms |
820 KB |
Correct. |
12 |
Correct |
2 ms |
812 KB |
Correct. |
13 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
824 KB |
Correct. |
3 |
Correct |
1 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
2 ms |
816 KB |
Correct. |
6 |
Correct |
1 ms |
820 KB |
Correct. |
7 |
Correct |
2 ms |
832 KB |
Correct. |
8 |
Correct |
2 ms |
824 KB |
Correct. |
9 |
Correct |
2 ms |
820 KB |
Correct. |
10 |
Correct |
2 ms |
820 KB |
Correct. |
11 |
Correct |
2 ms |
820 KB |
Correct. |
12 |
Correct |
2 ms |
812 KB |
Correct. |
13 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
14 |
Halted |
0 ms |
0 KB |
- |