답안 #730269

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
730269 2023-04-25T14:34:38 Z myrcella Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
80 ms 8752 KB
//by szh
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl
#define pq priority_queue
#define inf 0x3f
#define rep(i,a,b) for (int i=a;i<(b);i++)
#define MP make_pair
#define SZ(x) (int(x.size()))
#define ll long long
#define mod 1000000007
#define ALL(x) x.begin(),x.end()
void inc(int &a,int b) {a=(a+b)%mod;}
void dec(int &a,int b) {a=(a-b+mod)%mod;}
int lowbit(int x) {return x&(-x);}
ll p0w(ll base,ll p) {ll ret=1;while(p>0){if (p%2ll==1ll) ret=ret*base%mod;base=base*base%mod;p/=2ll;}return ret;}

#include "Anna.h"

void Anna(int N, std::vector<char> S) {
	bool ok = false;
	vector <int> tmp;
	for (int i = N-1;i>=0;i--) {
		if (S[i]=='Z') tmp.pb(1),ok = true;
		else if (ok and S[i]=='Y') tmp.pb(1);
		else ok = false,tmp.pb(0);
	}
	while (!tmp.empty()) Send(tmp.back()),tmp.pop_back();
	return;
}
//by szh
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl
#define pq priority_queue
#define inf 0x3f
#define rep(i,a,b) for (int i=a;i<(b);i++)
#define MP make_pair
#define SZ(x) (int(x.size()))
#define ll long long
#define mod 1000000007
#define ALL(x) x.begin(),x.end()
void inc(int &a,int b) {a=(a+b)%mod;}
void dec(int &a,int b) {a=(a-b+mod)%mod;}
int lowbit(int x) {return x&(-x);}
ll p0w(ll base,ll p) {ll ret=1;while(p>0){if (p%2ll==1ll) ret=ret*base%mod;base=base*base%mod;p/=2ll;}return ret;}

#include "Bruno.h"

void Bruno(int N, int L, std::vector<int> A) {
	int pos = -1;
	for (int i=L-1;i>=0;i--) if (A[i]==1) {
		pos = i;
		break;
	}
	rep(i,0,pos) if (A[i]==1) Remove(i);
	for (int i=N-1;i>=0;i--) if (A[i]==0) Remove(i);
	if (pos!=-1) Remove(pos);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 ms 520 KB Output is correct
3 Correct 1 ms 512 KB Output is correct
4 Correct 1 ms 600 KB Output is correct
5 Correct 0 ms 512 KB Output is correct
6 Correct 1 ms 512 KB Output is correct
7 Correct 1 ms 512 KB Output is correct
8 Correct 1 ms 596 KB Output is correct
9 Correct 0 ms 536 KB Output is correct
10 Correct 1 ms 612 KB Output is correct
11 Correct 1 ms 496 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 64 ms 8568 KB Partially correct
2 Partially correct 63 ms 8572 KB Partially correct
3 Partially correct 61 ms 8508 KB Partially correct
4 Partially correct 80 ms 8476 KB Partially correct
5 Partially correct 71 ms 8520 KB Partially correct
6 Partially correct 56 ms 8616 KB Partially correct
7 Partially correct 76 ms 8448 KB Partially correct
8 Partially correct 62 ms 8752 KB Partially correct
9 Partially correct 63 ms 8520 KB Partially correct
10 Partially correct 65 ms 8608 KB Partially correct
11 Partially correct 62 ms 8420 KB Partially correct
12 Partially correct 59 ms 8504 KB Partially correct
13 Partially correct 62 ms 8576 KB Partially correct
14 Partially correct 60 ms 8400 KB Partially correct
15 Partially correct 57 ms 8516 KB Partially correct
16 Partially correct 57 ms 8632 KB Partially correct
17 Partially correct 68 ms 8484 KB Partially correct
18 Partially correct 57 ms 8504 KB Partially correct
19 Partially correct 61 ms 8476 KB Partially correct
20 Partially correct 56 ms 8516 KB Partially correct
21 Partially correct 64 ms 8640 KB Partially correct
22 Partially correct 60 ms 8664 KB Partially correct
23 Partially correct 60 ms 8476 KB Partially correct
24 Partially correct 59 ms 8596 KB Partially correct
25 Partially correct 59 ms 8604 KB Partially correct
26 Partially correct 60 ms 8628 KB Partially correct
27 Partially correct 69 ms 8604 KB Partially correct
28 Partially correct 64 ms 8388 KB Partially correct
29 Partially correct 60 ms 8600 KB Partially correct
30 Partially correct 68 ms 8612 KB Partially correct
31 Partially correct 73 ms 8576 KB Partially correct
32 Partially correct 57 ms 8532 KB Partially correct
33 Partially correct 61 ms 8536 KB Partially correct