# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
750083 | 2023-05-29T06:38:37 Z | MrM7md | Zalmoxis (BOI18_zalmoxis) | C++17 | 377 ms | 92296 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define F first #define S second #define pb push_back #define all(a) a.begin(),a.end() const int N=1e3+25; const int off=(1<<18); const int MOD = 1e9+7; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,k; cin >> n >> k; vector<array<int,3>> a(n); for(int i=0;i<n;i++){ cin >> a[i][0]; a[i][1]=a[i][2]=i; } vector<array<int,3>>v=a; pair<int,int>kk; kk={-1,-1}; for(int i=0;i<=30;i++){ vector<array<int,3>>t; for(int j=0;j<v.size();j++){ if(j+1<v.size()&&v[j][0]==v[j+1][0]&&v[j][0]==i){ t.pb({v[j][0]+1,v[j][1],v[j+1][2]}); j++; } else if(v[j][0]==i&&kk.F==-1){ kk={v[j][0],v[j][2]}; // cout<<kk.F<<endl; } else{ t.pb(v[j]); } } v=t; } for(int i=0;i<n;i++){ cout<<a[i][0]<<' '; if(i==kk.S)cout<<kk.F<<' '; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 251 ms | 91092 KB | Output is correct |
2 | Correct | 273 ms | 91912 KB | Output is correct |
3 | Correct | 270 ms | 91468 KB | Output is correct |
4 | Correct | 274 ms | 91636 KB | Output is correct |
5 | Correct | 280 ms | 91708 KB | Output is correct |
6 | Correct | 248 ms | 90512 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 267 ms | 91360 KB | Unexpected end of file - int32 expected |
2 | Incorrect | 252 ms | 90616 KB | Unexpected end of file - int32 expected |
3 | Incorrect | 281 ms | 91888 KB | Unexpected end of file - int32 expected |
4 | Incorrect | 287 ms | 91900 KB | Unexpected end of file - int32 expected |
5 | Incorrect | 280 ms | 91656 KB | Unexpected end of file - int32 expected |
6 | Incorrect | 265 ms | 91276 KB | Unexpected end of file - int32 expected |
7 | Incorrect | 275 ms | 91808 KB | Unexpected end of file - int32 expected |
8 | Incorrect | 280 ms | 92296 KB | Unexpected end of file - int32 expected |
9 | Incorrect | 321 ms | 78784 KB | Unexpected end of file - int32 expected |
10 | Incorrect | 131 ms | 33116 KB | Unexpected end of file - int32 expected |
11 | Incorrect | 377 ms | 46308 KB | Unexpected end of file - int32 expected |
12 | Incorrect | 0 ms | 212 KB | Unexpected end of file - int32 expected |
13 | Incorrect | 0 ms | 212 KB | Unexpected end of file - int32 expected |
14 | Incorrect | 0 ms | 212 KB | Unexpected end of file - int32 expected |