#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <set>
typedef long long ll;
using namespace std;
const ll S = 500; //5e5 + 8
class Solution {
public:
ll N, R, mainRank;
vector<ll> rank;
ll help(){
cin >> N >> R >> mainRank;
for (int i = 1; i < 2 * N; i++){
ll R; cin >> R; rank.push_back(R);
}
if (mainRank == 1) return 1;
if (mainRank == 2) return (1 + R % N);
if (mainRank == 2 * N) return (N == 1? 1 : 2);
return -1;
}
};
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
Solution p;
cout << p.help() << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
736 KB |
Output isn't correct |
5 |
Incorrect |
20 ms |
5332 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
860 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
11 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
13 |
Incorrect |
17 ms |
2520 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
15 |
Incorrect |
4 ms |
992 KB |
Output isn't correct |
16 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
17 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
18 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
19 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
20 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
21 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
22 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
23 |
Incorrect |
20 ms |
4564 KB |
Output isn't correct |
24 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
25 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
26 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
27 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
28 |
Incorrect |
15 ms |
2520 KB |
Output isn't correct |
29 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
30 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
992 KB |
Output isn't correct |
32 |
Incorrect |
20 ms |
5592 KB |
Output isn't correct |
33 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
34 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
35 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
36 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
37 |
Incorrect |
2 ms |
992 KB |
Output isn't correct |
38 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
39 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
40 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
41 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
42 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
43 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
44 |
Incorrect |
2 ms |
736 KB |
Output isn't correct |
45 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
46 |
Incorrect |
3 ms |
992 KB |
Output isn't correct |
47 |
Incorrect |
22 ms |
4564 KB |
Output isn't correct |