Submission #598456

# Submission time Handle Problem Language Result Execution time Memory
598456 2022-07-18T11:31:06 Z mosiashvililuka Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
89 ms 10208 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);
    }
    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;
      |                                   ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1556 KB Output is correct
2 Correct 1 ms 1296 KB Output is correct
3 Correct 2 ms 1300 KB Output is correct
4 Correct 1 ms 1296 KB Output is correct
5 Correct 2 ms 1300 KB Output is correct
6 Correct 0 ms 1300 KB Output is correct
7 Correct 2 ms 1300 KB Output is correct
8 Correct 2 ms 1380 KB Output is correct
9 Correct 1 ms 1292 KB Output is correct
10 Incorrect 2 ms 1292 KB Wrong Answer [3]
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 74 ms 10108 KB Partially correct
2 Partially correct 82 ms 10004 KB Partially correct
3 Partially correct 71 ms 10068 KB Partially correct
4 Partially correct 73 ms 10116 KB Partially correct
5 Partially correct 71 ms 10208 KB Partially correct
6 Partially correct 76 ms 10072 KB Partially correct
7 Partially correct 71 ms 10008 KB Partially correct
8 Partially correct 89 ms 10120 KB Partially correct
9 Partially correct 73 ms 10072 KB Partially correct
10 Partially correct 88 ms 10088 KB Partially correct
11 Partially correct 86 ms 10068 KB Partially correct
12 Partially correct 84 ms 10172 KB Partially correct
13 Partially correct 75 ms 10000 KB Partially correct
14 Partially correct 88 ms 10176 KB Partially correct
15 Partially correct 75 ms 10096 KB Partially correct
16 Partially correct 77 ms 9996 KB Partially correct
17 Partially correct 76 ms 10144 KB Partially correct
18 Incorrect 71 ms 10180 KB Wrong Answer [3]
19 Halted 0 ms 0 KB -