답안 #750101

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
750101 2023-05-29T06:47:21 Z MrM7md Zalmoxis (BOI18_zalmoxis) C++17
35 / 100
299 ms 115668 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=1e6;
const int off=(1<<18);
const int MOD = 1e9+7;


vector<vector<int>>kk(N);
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;
   for(int i=0;i<=29;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){
            t.pb({v[j][0]+1,v[j][1],v[j][2]});
            kk[v[j][2]].pb(v[j][0]);
            // cout<<kk.F<<endl;
         }
         else{
            t.pb(v[j]);
         }
      }
      v=t;
   }
   int id=0;
   for(int i=0;i<n;i++){
      cout<<a[i][0]<<' ';
      for(auto it:kk[i])cout<<it<<' ';
   }
}

Compilation message

zalmoxis.cpp: In function 'int main()':
zalmoxis.cpp:27:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::array<long long int, 3> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |       for(int j=0;j<v.size();j++){
      |                   ~^~~~~~~~~
zalmoxis.cpp:28:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::array<long long int, 3> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |          if(j+1<v.size()&&v[j][0]==v[j+1][0]&&v[j][0]==i){
      |             ~~~^~~~~~~~~
zalmoxis.cpp:44:8: warning: unused variable 'id' [-Wunused-variable]
   44 |    int id=0;
      |        ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 264 ms 114652 KB Output is correct
2 Correct 284 ms 115436 KB Output is correct
3 Correct 288 ms 114996 KB Output is correct
4 Correct 278 ms 115068 KB Output is correct
5 Correct 292 ms 115284 KB Output is correct
6 Correct 258 ms 114068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 284 ms 114900 KB Unexpected end of file - int32 expected
2 Correct 268 ms 114056 KB Output is correct
3 Incorrect 281 ms 115268 KB Unexpected end of file - int32 expected
4 Incorrect 299 ms 115484 KB Unexpected end of file - int32 expected
5 Incorrect 283 ms 115104 KB Unexpected end of file - int32 expected
6 Incorrect 296 ms 114928 KB Unexpected end of file - int32 expected
7 Incorrect 286 ms 115256 KB Unexpected end of file - int32 expected
8 Incorrect 283 ms 115668 KB Unexpected end of file - int32 expected
9 Incorrect 227 ms 104368 KB Unexpected end of file - int32 expected
10 Incorrect 113 ms 57736 KB Unexpected end of file - int32 expected
11 Incorrect 156 ms 71492 KB Unexpected end of file - int32 expected
12 Incorrect 13 ms 23768 KB Unexpected end of file - int32 expected
13 Incorrect 13 ms 23708 KB Unexpected end of file - int32 expected
14 Incorrect 13 ms 23764 KB Unexpected end of file - int32 expected