#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n,k;
cin >> n >> k;
vector <ll> arr(n);
vector <ll> low;
ll mini = 30;
for (int z=0;z<n;z++){
cin >> arr[z];
}
ll c = 0;
bool ok = true;
for (int z=0;z<n;z++){
c += 1 << arr[z];
for (int q=0;q<arr[z] && ok;q++){
if (c & (1 << q)){
ok = false;
cout << q << " ";
c += 1 << q;
break;
}
}
cout << arr[z] << " ";
}
if (ok){
cout << arr[n-1] << " ";
}
cout << endl;
}
Compilation message
zalmoxis.cpp: In function 'int main()':
zalmoxis.cpp:23:8: warning: unused variable 'mini' [-Wunused-variable]
ll mini = 30;
^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
167 ms |
12296 KB |
not a zalsequence |
2 |
Incorrect |
165 ms |
12408 KB |
not a zalsequence |
3 |
Incorrect |
167 ms |
12376 KB |
not a zalsequence |
4 |
Correct |
169 ms |
12512 KB |
Output is correct |
5 |
Correct |
170 ms |
12280 KB |
Output is correct |
6 |
Incorrect |
167 ms |
12280 KB |
not a zalsequence |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
151 ms |
12312 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
151 ms |
12408 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
158 ms |
12408 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
150 ms |
12408 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
150 ms |
12408 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
157 ms |
12448 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
150 ms |
12376 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
151 ms |
12476 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
137 ms |
10012 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
47 ms |
4004 KB |
Unexpected end of file - int32 expected |
11 |
Incorrect |
78 ms |
6376 KB |
Unexpected end of file - int32 expected |
12 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - int32 expected |
13 |
Incorrect |
0 ms |
376 KB |
Unexpected end of file - int32 expected |
14 |
Incorrect |
2 ms |
380 KB |
Unexpected end of file - int32 expected |