Submission #935641

# Submission time Handle Problem Language Result Execution time Memory
935641 2024-02-29T10:08:34 Z billyisme Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
76 ms 12780 KB
/***************************************************************
*             Author : Nguyen Trong Van Viet                   *
*                        Age : 17                              *
*      School : 12T2 Le Khiet High School for the Gifted       *
*            Hometown :  Quang Ngai , Viet Nam .               *
* Khanh An is my lover :) the more I code  , the nearer I am   *
****************************************************************/
#define TASK "text"
#define INPUT TASK".INP" 
#define OUTPUT TASK".OUT"

bool mtt = 0 ;
int test = 1 ;  

#include<bits/stdc++.h>
using namespace std; 

#define             ll  long long 
#define             db  double 
#define             ve  vector 
#define             vi  vector<int>
#define            vll  vector<ll>
#define            str  string
#define             pb  push_back
#define             pk  pop_back
#define             el  '\n'
#define            pii  pair<int,int>
#define            pll  pair<ll,ll>
#define             mp  make_pair 
#define             fi  first 
#define             se  second
#define         uni(a)  sort(all(a)),a.resize(unique(all(a))-a.begin()) 
#define     FOR(i,a,b)  for(int i=(int)(a);i<=(int)(b);i++)
#define    FORD(i,a,b)  for(int i=(int)(a);i>=(int)(b);i--)
#define    FORN(i,a,b)  for(int i=(int)(a);i<(int)(b);i++)
#define         all(a)  a.begin(),a.end()  
#define             LB  lower_bound
#define             UB  upper_bound 
#define            tct  template<class T>
#define     BIT(msk,i)  (msk>>(i)&1)
#define        M(i)  (1ll<<(i))
#define          SZ(_)  (int)(_.size())
#define           btpc  __builtin_popcountll
#define            ctz  __builtin_ctzll 
ll lg(ll a){return __lg(a);}
ll sq(ll a){return a*a;}  
ll gcd(ll a,ll b){return __gcd(a,b);} 
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll rd(ll l , ll r ){return l+1LL*rand()*rand()%(r-l+1);}
#define prt(a,n) {FOR(_i,1,n)cout<<a[_i]<<" ";cout<<el;}
#define prv(a) {for(auto _v:a)cout<<_v<<" "; cout<<el;} 

int xx[] = {0,-1,0,1} ; 
int yy[] = {-1,0,1,0} ;

const db PI = acos(-1) , EPS = 1e-9;
const ll inf = 1e18 , cs = 331 , sm = 1e9+7; 
const int N = 2e5+5 , oo = 2e9 , LO = 17 , CH = 26 ; 

tct bool mini(T& a,T b){return (a>b)?a=b,1:0;}
tct bool maxi(T& a,T b){return (a<b)?a=b,1:0;} 

void add(ll& a , ll b){a+=b;if(a>=sm)a-=sm;}
void sub(ll& a , ll b){a-=b;if(a<0)a+=sm;}


/*  DON'T BELIEVE LOVE WILL INSPIRE YOU ->  TRAIN HARDER ->  YOU WILL GET THE LOVE YOU WANT !!*/
#include "Anna.h" 

void Anna(int n , ve<char>S)
{   
    bool X= 0  ;
    FORN(i,0,n)
    {
        if(X==0)
        {
            if(S[i]=='X')
            {   
                X = 1; 
                Send(1) ; 
            }
            else Send(0) ; 
        }
        else 
        {
            if(S[i]=='Y')
            {
                Send(0) ; 
            }
            else if(S[i]=='Z')
            {
                Send(1) ;
            }
            else Send(0) ; 
        } 
    }
}	
/***************************************************************
*             Author : Nguyen Trong Van Viet                   *
*                        Age : 17                              *
*      School : 12T2 Le Khiet High School for the Gifted       *
*            Hometown :  Quang Ngai , Viet Nam .               *
* Khanh An is my lover :) the more I code  , the nearer I am   *
****************************************************************/
#define TASK "text"
#define INPUT TASK".INP" 
#define OUTPUT TASK".OUT"

bool mtt = 0 ;
int test = 1 ;  

#include<bits/stdc++.h>
using namespace std; 

#define             ll  long long 
#define             db  double 
#define             ve  vector 
#define             vi  vector<int>
#define            vll  vector<ll>
#define            str  string
#define             pb  push_back
#define             pk  pop_back
#define             el  '\n'
#define            pii  pair<int,int>
#define            pll  pair<ll,ll>
#define             mp  make_pair 
#define             fi  first 
#define             se  second
#define         uni(a)  sort(all(a)),a.resize(unique(all(a))-a.begin()) 
#define     FOR(i,a,b)  for(int i=(int)(a);i<=(int)(b);i++)
#define    FORD(i,a,b)  for(int i=(int)(a);i>=(int)(b);i--)
#define    FORN(i,a,b)  for(int i=(int)(a);i<(int)(b);i++)
#define         all(a)  a.begin(),a.end()  
#define             LB  lower_bound
#define             UB  upper_bound 
#define            tct  template<class T>
#define     BIT(msk,i)  (msk>>(i)&1)
#define        M(i)  (1ll<<(i))
#define          SZ(_)  (int)(_.size())
#define           btpc  __builtin_popcountll
#define            ctz  __builtin_ctzll 
ll lg(ll a){return __lg(a);}
ll sq(ll a){return a*a;}  
ll gcd(ll a,ll b){return __gcd(a,b);} 
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll rd(ll l , ll r ){return l+1LL*rand()*rand()%(r-l+1);}
#define prt(a,n) {FOR(_i,1,n)cout<<a[_i]<<" ";cout<<el;}
#define prv(a) {for(auto _v:a)cout<<_v<<" "; cout<<el;} 

int xx[] = {0,-1,0,1} ; 
int yy[] = {-1,0,1,0} ;

const db PI = acos(-1) , EPS = 1e-9;
const ll inf = 1e18 , cs = 331 , sm = 1e9+7; 
const int N = 2e5+5 , oo = 2e9 , LO = 17 , CH = 26 ; 

tct bool mini(T& a,T b){return (a>b)?a=b,1:0;}
tct bool maxi(T& a,T b){return (a<b)?a=b,1:0;} 

void sub(ll& a , ll b){a-=b;if(a<0)a+=sm;}


/*  DON'T BELIEVE LOVE WILL INSPIRE YOU ->  TRAIN HARDER ->  YOU WILL GET THE LOVE YOU WANT !!*/
#include "Bruno.h" 
void Bruno(int n,int L , vi A)
{
    set<int>cl ; 
    FORN(i,0,n)cl.insert(i) ; 
    int st=-1 ; 
    FORN(i,0,n) 
    {
        if(A[i]==1)
        {
            if(st==-1)
            {
                FOR(j,0,i-1)
                {
                    if(cl.count(j))Remove(j),cl.erase(j) ; 
                    else break;
                }
                st=i;
            } 
            else
            {
                FORD(j,i-1,st+1)
                {
                    if(cl.count(j))Remove(j),cl.erase(j) ; 
                    else break;
                }
                Remove(i) ;
                cl.erase(i) ; 
            }
        }
    }     
    for(auto u  : cl)Remove(u) ; 
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 804 KB Output is correct
2 Correct 0 ms 780 KB Output is correct
3 Correct 0 ms 792 KB Output is correct
4 Correct 0 ms 1296 KB Output is correct
5 Correct 0 ms 780 KB Output is correct
6 Correct 1 ms 780 KB Output is correct
7 Correct 0 ms 780 KB Output is correct
8 Correct 0 ms 792 KB Output is correct
9 Correct 0 ms 780 KB Output is correct
10 Correct 0 ms 792 KB Output is correct
11 Correct 1 ms 780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 65 ms 8056 KB Partially correct
2 Partially correct 62 ms 7976 KB Partially correct
3 Partially correct 61 ms 7896 KB Partially correct
4 Partially correct 62 ms 7928 KB Partially correct
5 Partially correct 61 ms 8008 KB Partially correct
6 Partially correct 76 ms 7860 KB Partially correct
7 Partially correct 61 ms 8036 KB Partially correct
8 Partially correct 61 ms 7940 KB Partially correct
9 Partially correct 61 ms 7940 KB Partially correct
10 Partially correct 63 ms 7912 KB Partially correct
11 Partially correct 62 ms 7968 KB Partially correct
12 Partially correct 66 ms 7920 KB Partially correct
13 Partially correct 65 ms 7992 KB Partially correct
14 Partially correct 69 ms 7964 KB Partially correct
15 Partially correct 64 ms 7976 KB Partially correct
16 Partially correct 62 ms 7932 KB Partially correct
17 Partially correct 65 ms 12420 KB Partially correct
18 Partially correct 62 ms 12540 KB Partially correct
19 Partially correct 63 ms 12780 KB Partially correct
20 Partially correct 72 ms 8056 KB Partially correct
21 Partially correct 61 ms 7932 KB Partially correct
22 Partially correct 65 ms 7992 KB Partially correct
23 Partially correct 61 ms 7916 KB Partially correct
24 Partially correct 59 ms 7928 KB Partially correct
25 Partially correct 61 ms 12396 KB Partially correct
26 Partially correct 66 ms 12548 KB Partially correct
27 Partially correct 64 ms 8024 KB Partially correct
28 Partially correct 64 ms 12516 KB Partially correct
29 Partially correct 63 ms 12604 KB Partially correct
30 Partially correct 66 ms 7940 KB Partially correct
31 Partially correct 67 ms 12552 KB Partially correct
32 Partially correct 62 ms 7912 KB Partially correct
33 Partially correct 65 ms 7976 KB Partially correct