# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
278168 |
2020-08-21T11:05:48 Z |
test2 |
Zalmoxis (BOI18_zalmoxis) |
C++14 |
|
172 ms |
10652 KB |
#include<bits/stdc++.h>
#define I inline void
using namespace std ;
using ll = long long ;
using ld = long double ;
const int N = 2e6 + 7 ;
// How interesting!
int n , k ;
int a[N] ;
int used = 0 ;
int dfs(int x , int val){
if(a[x] > val){
cout<< val <<" " ;
used ++ ;
assert(used < 2) ;
return x ;
}
if(a[x] == val){
cout<< val <<" " ;
return x + 1 ;
}
int ret1 = dfs(x , val - 1) ;
int ret2 = dfs(ret1 , val -1 ) ;
return ret2 ;
}
int main(){
ios_base::sync_with_stdio(0) ;
cin.tie(0) ;
//freopen("in.in", "r" , stdin) ;
cin >> n >> k ;
a[n] = (1<<30) ;
for(int i = 0 ;i < n ; i++){
cin >> a[i] ;
}
dfs(0 , 30 ) ;
return 0 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
157 ms |
6392 KB |
Output is correct |
2 |
Correct |
152 ms |
6392 KB |
Output is correct |
3 |
Correct |
152 ms |
6392 KB |
Output is correct |
4 |
Correct |
150 ms |
6392 KB |
Output is correct |
5 |
Correct |
172 ms |
6424 KB |
Output is correct |
6 |
Correct |
160 ms |
6392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
71 ms |
8444 KB |
Execution killed with signal 11 |
2 |
Runtime error |
75 ms |
8540 KB |
Execution killed with signal 11 |
3 |
Runtime error |
84 ms |
8440 KB |
Execution killed with signal 11 |
4 |
Runtime error |
77 ms |
8572 KB |
Execution killed with signal 11 |
5 |
Runtime error |
73 ms |
8440 KB |
Execution killed with signal 11 |
6 |
Runtime error |
77 ms |
8440 KB |
Execution killed with signal 11 |
7 |
Runtime error |
163 ms |
10652 KB |
Execution killed with signal 11 |
8 |
Runtime error |
77 ms |
8568 KB |
Execution killed with signal 11 |
9 |
Runtime error |
57 ms |
7036 KB |
Execution killed with signal 11 |
10 |
Runtime error |
22 ms |
2944 KB |
Execution killed with signal 11 |
11 |
Runtime error |
38 ms |
4472 KB |
Execution killed with signal 11 |
12 |
Runtime error |
1 ms |
512 KB |
Execution killed with signal 11 |
13 |
Runtime error |
1 ms |
512 KB |
Execution killed with signal 11 |
14 |
Runtime error |
2 ms |
512 KB |
Execution killed with signal 11 |