답안 #419499

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
419499 2021-06-07T07:57:27 Z alishahali1382 Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
87 ms 8304 KB
#include "Anna.h"
#include <bits/stdc++.h>
#pragma GCC optimize ("O2,unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugp(x) cerr<<#x<<"= {"<<(x.first)<<", "<<(x.second)<<"}"<<endl;
#define debug2(x, y) cerr<<"{"<<#x<<", "<<#y<<"} = {"<<(x)<<", "<<(y)<<"}"<<endl;
#define debugv(v) {cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;}
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const int inf=1000000010;
const ll INF=1000000000000001000LL;
const int mod=1000000007;
const int MAXN=100010, LOG=20;

bool A[MAXN];

void Anna(int n, vector<char> S){
	int posx=n;
	for (int i=0; i<n; i++) if (S[i]=='X'){
		posx=i;
		break ;
	}
	for (int i=0; i<posx; i++) Send(1);
	for (int i=posx; i<n; i++){
		if (S[i]=='Z') Send(1);
		else Send(0);
	}
}

#include "Bruno.h"
#include <bits/stdc++.h>
#pragma GCC optimize ("O2,unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugp(x) cerr<<#x<<"= {"<<(x.first)<<", "<<(x.second)<<"}"<<endl;
#define debug2(x, y) cerr<<"{"<<#x<<", "<<#y<<"} = {"<<(x)<<", "<<(y)<<"}"<<endl;
#define debugv(v) {cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;}
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const int inf=1000000010;
const ll INF=1000000000000001000LL;
const int mod=1000000007;
const int MAXN=100010, LOG=20;

int n, m, k, u, v, x, y, t, a, b, ans;
char S[MAXN];
int stk[MAXN], sz;
bool mark[MAXN];

inline void Rem(int x){
//	debug(x)
//	if (mark[x]) debug("fuck")
	Remove(x);
	mark[x]=1;
}

void Bruno(int n, int m, vector<int> A){
	for (int i=0; i<n; i++){
		if (!A[i]){
			stk[++sz]=i;
		}
		else{
			while (sz>1) Rem(stk[sz--]);
			Rem(i);
		}
	}
	while (sz) Rem(stk[sz--]);

	for (int i=0; i<n; i++) if (!mark[i]) Remove(i);
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 488 KB Output is correct
2 Correct 1 ms 484 KB Output is correct
3 Correct 2 ms 416 KB Output is correct
4 Correct 2 ms 484 KB Output is correct
5 Correct 2 ms 484 KB Output is correct
6 Correct 1 ms 484 KB Output is correct
7 Correct 1 ms 484 KB Output is correct
8 Correct 1 ms 492 KB Output is correct
9 Correct 1 ms 484 KB Output is correct
10 Correct 1 ms 480 KB Output is correct
11 Correct 1 ms 484 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 63 ms 7792 KB Partially correct
2 Partially correct 66 ms 7800 KB Partially correct
3 Partially correct 66 ms 7688 KB Partially correct
4 Partially correct 69 ms 7768 KB Partially correct
5 Partially correct 67 ms 7772 KB Partially correct
6 Partially correct 63 ms 7852 KB Partially correct
7 Partially correct 64 ms 7828 KB Partially correct
8 Partially correct 65 ms 7880 KB Partially correct
9 Partially correct 87 ms 7728 KB Partially correct
10 Partially correct 64 ms 7744 KB Partially correct
11 Partially correct 65 ms 7880 KB Partially correct
12 Partially correct 64 ms 7780 KB Partially correct
13 Partially correct 72 ms 8304 KB Partially correct
14 Partially correct 72 ms 7704 KB Partially correct
15 Partially correct 67 ms 7676 KB Partially correct
16 Partially correct 72 ms 7848 KB Partially correct
17 Partially correct 72 ms 8144 KB Partially correct
18 Partially correct 73 ms 7884 KB Partially correct
19 Partially correct 70 ms 7868 KB Partially correct
20 Partially correct 61 ms 7736 KB Partially correct
21 Partially correct 65 ms 7736 KB Partially correct
22 Partially correct 73 ms 8172 KB Partially correct
23 Partially correct 61 ms 7796 KB Partially correct
24 Partially correct 61 ms 7752 KB Partially correct
25 Partially correct 69 ms 7740 KB Partially correct
26 Partially correct 72 ms 8192 KB Partially correct
27 Partially correct 70 ms 7800 KB Partially correct
28 Partially correct 73 ms 8244 KB Partially correct
29 Partially correct 70 ms 7776 KB Partially correct
30 Partially correct 72 ms 7788 KB Partially correct
31 Partially correct 69 ms 7792 KB Partially correct
32 Partially correct 69 ms 7836 KB Partially correct
33 Partially correct 62 ms 7876 KB Partially correct