# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1006587 |
2024-06-24T04:21:11 Z |
huutuan |
Archery (IOI09_archery) |
C++14 |
|
2000 ms |
6236 KB |
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int n, r, s, a[N], b[N];
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> r >> s;
r=(r-n*2)%n+n*2;
for (int i=1; i<n*2; ++i) cin >> b[i];
pair<int, int> ans={n*2, n*2};
for (int i=1; i<=n; ++i){
for (int j=1; j<i*2; ++j) a[j]=b[j];
a[i*2]=s;
for (int j=i*2+1; j<=n*2; ++j) a[j]=b[j-1];
for (int _=1; _<=r; ++_){
for (int j=1; j<=n*2; j+=2) if (a[j]>a[j+1]) swap(a[j], a[j+1]);
swap(a[1], a[2]);
int tmp=a[1];
for (int j=3; j<=n*2; j+=2) a[j-2]=a[j];
a[n*2-1]=tmp;
}
int pos=0;
for (int j=1; j<=n*2; ++j) if (a[j]==s) pos=(j+1)/2;
ans=min(ans, {pos, i});
}
cout << ans.second << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Execution timed out |
2037 ms |
348 KB |
Time limit exceeded |
3 |
Incorrect |
3 ms |
348 KB |
Output isn't correct |
4 |
Execution timed out |
2092 ms |
348 KB |
Time limit exceeded |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
18 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Incorrect |
23 ms |
468 KB |
Output isn't correct |
3 |
Execution timed out |
2020 ms |
348 KB |
Time limit exceeded |
4 |
Execution timed out |
2052 ms |
860 KB |
Time limit exceeded |
5 |
Runtime error |
19 ms |
5468 KB |
Execution killed with signal 11 |
6 |
Incorrect |
18 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1483 ms |
472 KB |
Output isn't correct |
8 |
Execution timed out |
2043 ms |
860 KB |
Time limit exceeded |
9 |
Execution timed out |
2004 ms |
852 KB |
Time limit exceeded |
10 |
Execution timed out |
2084 ms |
348 KB |
Time limit exceeded |
11 |
Execution timed out |
2075 ms |
860 KB |
Time limit exceeded |
12 |
Execution timed out |
2066 ms |
348 KB |
Time limit exceeded |
13 |
Runtime error |
13 ms |
4064 KB |
Execution killed with signal 11 |
14 |
Execution timed out |
2094 ms |
348 KB |
Time limit exceeded |
15 |
Execution timed out |
2016 ms |
1116 KB |
Time limit exceeded |
16 |
Incorrect |
20 ms |
348 KB |
Output isn't correct |
17 |
Execution timed out |
2068 ms |
348 KB |
Time limit exceeded |
18 |
Execution timed out |
2019 ms |
348 KB |
Time limit exceeded |
19 |
Execution timed out |
2068 ms |
348 KB |
Time limit exceeded |
20 |
Execution timed out |
2065 ms |
348 KB |
Time limit exceeded |
21 |
Execution timed out |
2039 ms |
860 KB |
Time limit exceeded |
22 |
Execution timed out |
2019 ms |
1624 KB |
Time limit exceeded |
23 |
Runtime error |
20 ms |
5724 KB |
Execution killed with signal 11 |
24 |
Incorrect |
20 ms |
472 KB |
Output isn't correct |
25 |
Execution timed out |
2039 ms |
348 KB |
Time limit exceeded |
26 |
Execution timed out |
2057 ms |
348 KB |
Time limit exceeded |
27 |
Execution timed out |
2069 ms |
860 KB |
Time limit exceeded |
28 |
Runtime error |
14 ms |
4180 KB |
Execution killed with signal 11 |
29 |
Execution timed out |
2039 ms |
348 KB |
Time limit exceeded |
30 |
Execution timed out |
2054 ms |
348 KB |
Time limit exceeded |
31 |
Execution timed out |
2066 ms |
860 KB |
Time limit exceeded |
32 |
Runtime error |
18 ms |
5468 KB |
Execution killed with signal 11 |
33 |
Correct |
23 ms |
472 KB |
Output is correct |
34 |
Correct |
20 ms |
600 KB |
Output is correct |
35 |
Execution timed out |
2052 ms |
492 KB |
Time limit exceeded |
36 |
Execution timed out |
2071 ms |
348 KB |
Time limit exceeded |
37 |
Execution timed out |
2032 ms |
860 KB |
Time limit exceeded |
38 |
Execution timed out |
2020 ms |
1116 KB |
Time limit exceeded |
39 |
Correct |
19 ms |
348 KB |
Output is correct |
40 |
Execution timed out |
2095 ms |
348 KB |
Time limit exceeded |
41 |
Execution timed out |
2078 ms |
348 KB |
Time limit exceeded |
42 |
Execution timed out |
2079 ms |
348 KB |
Time limit exceeded |
43 |
Execution timed out |
2059 ms |
348 KB |
Time limit exceeded |
44 |
Execution timed out |
2062 ms |
604 KB |
Time limit exceeded |
45 |
Execution timed out |
2063 ms |
860 KB |
Time limit exceeded |
46 |
Execution timed out |
2058 ms |
860 KB |
Time limit exceeded |
47 |
Runtime error |
22 ms |
6236 KB |
Execution killed with signal 11 |