#include "Alice.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<pair<int, int>> Alice() {
ll x=setN(5000);
vector<pair<int,int> >edges;
for(int i=2;i<=5000;i++){
edges.push_back({i,x%(i-1)+1});
}
return edges;
}
#include <bits/stdc++.h>
#include "Bob.h"
#define ll long long
using namespace std;
long long Bob(vector<pair<int,int>> v) {
for(int i=0;i<v.size();i++){
v[i].first--,v[i].second--;
if(v[i].first<v[i].second){
swap(v[i].first,v[i].second);
}
}
sort(v.begin(),v.end());
ll val=-1,add;
for(int i=0;i<v.size();i++){
if(val==-1){val=v[i].second;add=v[i].first;}
else{
while(val%v[i].first!=v[i].second){
val+=add;
}
add=lcm(add,v[i].first);
}
}
return val;
}
Compilation message
Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:7:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
7 | for(int i=0;i<v.size();i++){
| ~^~~~~~~~~
Bob.cpp:15:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
15 | 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 |
832 KB |
Correct. |
3 |
Correct |
2 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
2 ms |
824 KB |
Correct. |
6 |
Correct |
2 ms |
828 KB |
Correct. |
7 |
Correct |
2 ms |
832 KB |
Correct. |
8 |
Correct |
2 ms |
820 KB |
Correct. |
9 |
Correct |
2 ms |
832 KB |
Correct. |
10 |
Correct |
3 ms |
832 KB |
Correct. |
11 |
Correct |
2 ms |
832 KB |
Correct. |
12 |
Correct |
2 ms |
816 KB |
Correct. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
832 KB |
Correct. |
3 |
Correct |
2 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
2 ms |
824 KB |
Correct. |
6 |
Correct |
2 ms |
828 KB |
Correct. |
7 |
Correct |
2 ms |
832 KB |
Correct. |
8 |
Correct |
2 ms |
820 KB |
Correct. |
9 |
Correct |
2 ms |
832 KB |
Correct. |
10 |
Correct |
3 ms |
832 KB |
Correct. |
11 |
Correct |
2 ms |
832 KB |
Correct. |
12 |
Correct |
2 ms |
816 KB |
Correct. |
13 |
Correct |
2 ms |
832 KB |
Correct. |
14 |
Correct |
2 ms |
824 KB |
Correct. |
15 |
Correct |
2 ms |
820 KB |
Correct. |
16 |
Correct |
2 ms |
820 KB |
Correct. |
17 |
Correct |
2 ms |
832 KB |
Correct. |
18 |
Correct |
2 ms |
832 KB |
Correct. |
19 |
Correct |
2 ms |
832 KB |
Correct. |
20 |
Correct |
2 ms |
832 KB |
Correct. |
21 |
Correct |
2 ms |
820 KB |
Correct. |
22 |
Correct |
2 ms |
820 KB |
Correct. |
23 |
Correct |
2 ms |
820 KB |
Correct. |
24 |
Correct |
2 ms |
824 KB |
Correct. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
832 KB |
Correct. |
3 |
Correct |
2 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
2 ms |
824 KB |
Correct. |
6 |
Correct |
2 ms |
828 KB |
Correct. |
7 |
Correct |
2 ms |
832 KB |
Correct. |
8 |
Correct |
2 ms |
820 KB |
Correct. |
9 |
Correct |
2 ms |
832 KB |
Correct. |
10 |
Correct |
3 ms |
832 KB |
Correct. |
11 |
Correct |
2 ms |
832 KB |
Correct. |
12 |
Correct |
2 ms |
816 KB |
Correct. |
13 |
Correct |
2 ms |
832 KB |
Correct. |
14 |
Correct |
2 ms |
824 KB |
Correct. |
15 |
Correct |
2 ms |
820 KB |
Correct. |
16 |
Correct |
2 ms |
820 KB |
Correct. |
17 |
Correct |
2 ms |
832 KB |
Correct. |
18 |
Correct |
2 ms |
832 KB |
Correct. |
19 |
Correct |
2 ms |
832 KB |
Correct. |
20 |
Correct |
2 ms |
832 KB |
Correct. |
21 |
Correct |
2 ms |
820 KB |
Correct. |
22 |
Correct |
2 ms |
820 KB |
Correct. |
23 |
Correct |
2 ms |
820 KB |
Correct. |
24 |
Correct |
2 ms |
824 KB |
Correct. |
25 |
Correct |
2 ms |
820 KB |
Correct. |
26 |
Correct |
2 ms |
844 KB |
Correct. |
27 |
Correct |
2 ms |
820 KB |
Correct. |
28 |
Correct |
2 ms |
820 KB |
Correct. |
29 |
Correct |
2 ms |
820 KB |
Correct. |
30 |
Correct |
2 ms |
944 KB |
Correct. |
31 |
Correct |
2 ms |
820 KB |
Correct. |
32 |
Correct |
2 ms |
820 KB |
Correct. |
33 |
Correct |
2 ms |
836 KB |
Correct. |
34 |
Correct |
2 ms |
832 KB |
Correct. |
35 |
Correct |
2 ms |
820 KB |
Correct. |
36 |
Correct |
2 ms |
820 KB |
Correct. |
37 |
Correct |
2 ms |
820 KB |
Correct. |
38 |
Correct |
2 ms |
820 KB |
Correct. |
39 |
Correct |
2 ms |
820 KB |
Correct. |
40 |
Correct |
2 ms |
832 KB |
Correct. |
41 |
Correct |
2 ms |
820 KB |
Correct. |
42 |
Correct |
2 ms |
820 KB |
Correct. |
43 |
Correct |
3 ms |
820 KB |
Correct. |
44 |
Correct |
2 ms |
820 KB |
Correct. |