답안 #598460

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
598460 2022-07-18T11:33:35 Z mosiashvililuka Ancient Machine (JOI21_ancient_machine) C++17
30 / 100
94 ms 10236 KB
#include<bits/stdc++.h>
#include "Anna.h"
using namespace std;
void Anna(int NN, std::vector<char> SS) {
    int a,b,c,d,e,i,j,ii,jj,zx,xc;
    vector <int> f(100009);
    a=NN;
    for(i=1; i<=a; i++){
        if(SS[i-1]=='X') f[i]=0;
        if(SS[i-1]=='Y') f[i]=1;
        if(SS[i-1]=='Z') f[i]=2;
    }

    for(i=1; i<=a; i++){
        if(f[i]==0){
            Send(0);Send(0);
        }
        if(f[i]==1){
            Send(1);Send(0);
        }
        if(f[i]==2){
            Send(1);Send(1);
        }
    }
}
#include<bits/stdc++.h>
#include "Bruno.h"
using namespace std;
namespace {
void rem(int q){
    Remove(q-1);
}
}
void Bruno(int NN, int LL, std::vector<int> AA) {
    int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
    vector <int> f(100009);
    a=NN;L=LL;
    for(i=1; i<=a; i++){
        ii=i*2-2;jj=i*2-1;
        if(AA[ii]==1) f[i]++;
        if(AA[jj]==1) f[i]++;
    }
    for(i=1; i<=a; i++){
        if(f[i]==0){
            break;
        }
        rem(i);
    }
    if(i>a) return;
    I=i;ii=i;
    for(i=I+1; i<=a; i++){
        if(f[i]==2){
            for(j=i-1; j>ii; j--){
                rem(j);
            }
            rem(i);
            ii=i;
            continue;
        }
    }
    for(i=a; i>ii; i--) rem(i);
    rem(I);
}

Compilation message

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:5:11: warning: unused variable 'b' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |           ^
Anna.cpp:5:13: warning: unused variable 'c' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |             ^
Anna.cpp:5:15: warning: unused variable 'd' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |               ^
Anna.cpp:5:17: warning: unused variable 'e' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |                 ^
Anna.cpp:5:21: warning: unused variable 'j' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |                     ^
Anna.cpp:5:23: warning: unused variable 'ii' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |                       ^~
Anna.cpp:5:26: warning: unused variable 'jj' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |                          ^~
Anna.cpp:5:29: warning: unused variable 'zx' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |                             ^~
Anna.cpp:5:32: warning: unused variable 'xc' [-Wunused-variable]
    5 |     int a,b,c,d,e,i,j,ii,jj,zx,xc;
      |                                ^~

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:10:11: warning: unused variable 'b' [-Wunused-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |           ^
Bruno.cpp:10:13: warning: unused variable 'c' [-Wunused-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |             ^
Bruno.cpp:10:15: warning: unused variable 'd' [-Wunused-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |               ^
Bruno.cpp:10:17: warning: unused variable 'e' [-Wunused-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |                 ^
Bruno.cpp:10:29: warning: unused variable 'zx' [-Wunused-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |                             ^~
Bruno.cpp:10:32: warning: unused variable 'xc' [-Wunused-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |                                ^~
Bruno.cpp:10:35: warning: variable 'L' set but not used [-Wunused-but-set-variable]
   10 |     int a,b,c,d,e,i,j,ii,jj,zx,xc,L,I;
      |                                   ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1288 KB Output is correct
2 Correct 2 ms 1284 KB Output is correct
3 Correct 1 ms 1288 KB Output is correct
4 Correct 2 ms 1288 KB Output is correct
5 Correct 0 ms 1300 KB Output is correct
6 Correct 0 ms 1296 KB Output is correct
7 Correct 1 ms 1300 KB Output is correct
8 Correct 1 ms 1296 KB Output is correct
9 Correct 1 ms 1288 KB Output is correct
10 Correct 1 ms 1288 KB Output is correct
11 Correct 2 ms 1380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 70 ms 9660 KB Partially correct
2 Partially correct 68 ms 9776 KB Partially correct
3 Partially correct 87 ms 9784 KB Partially correct
4 Partially correct 69 ms 9808 KB Partially correct
5 Partially correct 75 ms 9752 KB Partially correct
6 Partially correct 68 ms 9632 KB Partially correct
7 Partially correct 68 ms 9652 KB Partially correct
8 Partially correct 71 ms 9716 KB Partially correct
9 Partially correct 74 ms 9696 KB Partially correct
10 Partially correct 72 ms 9696 KB Partially correct
11 Partially correct 76 ms 9628 KB Partially correct
12 Partially correct 70 ms 9640 KB Partially correct
13 Partially correct 77 ms 9764 KB Partially correct
14 Partially correct 71 ms 9636 KB Partially correct
15 Partially correct 75 ms 9644 KB Partially correct
16 Partially correct 71 ms 9700 KB Partially correct
17 Partially correct 76 ms 9772 KB Partially correct
18 Partially correct 77 ms 9644 KB Partially correct
19 Partially correct 94 ms 10188 KB Partially correct
20 Partially correct 65 ms 10096 KB Partially correct
21 Partially correct 73 ms 10184 KB Partially correct
22 Partially correct 76 ms 10096 KB Partially correct
23 Partially correct 88 ms 10132 KB Partially correct
24 Partially correct 65 ms 10100 KB Partially correct
25 Partially correct 76 ms 10096 KB Partially correct
26 Partially correct 83 ms 10096 KB Partially correct
27 Partially correct 79 ms 10132 KB Partially correct
28 Partially correct 77 ms 10196 KB Partially correct
29 Partially correct 79 ms 10236 KB Partially correct
30 Partially correct 92 ms 10116 KB Partially correct
31 Partially correct 83 ms 10048 KB Partially correct
32 Partially correct 67 ms 10148 KB Partially correct
33 Partially correct 79 ms 10096 KB Partially correct