답안 #417438

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
417438 2021-06-03T17:44:41 Z errorgorn Ancient Machine (JOI21_ancient_machine) C++17
69 / 100
81 ms 8856 KB
#include "Anna.h"

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

#define ll long long
#define ii pair<ll,ll>
#define fi first
#define se second
#define endl '\n'

#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound

#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);(s<e?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()

namespace {
	int n;
	string s;
}

void Anna(int N, std::vector<char> S) {
	n=N;
	rep(x,0,n) s+=S[x];
	
	int pos=0;
	rep(x,0,n) if (s[x]=='X'){
		pos=x;
		break;
	}
	
	rep(x,0,17){
		if (pos&1) Send(1);
		else Send(0);
		pos>>=1;
	}
	rep(x,0,n){
		if (s[x]=='Z') Send(1);
		else Send(0);
	}
}
#include "Bruno.h"

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

#define ll long long
#define ii pair<ll,ll>
#define fi first
#define se second
#define endl '\n'

#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound

#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);(s<e?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()

namespace {
	int n,l;
	vector<int> bits;
	string s;
	
	set<int> z;
}  // namespace

void Bruno(int N, int L, std::vector<int> A) {
	n=N,l=L,bits=A;
	
	int pos=0;
	rep(x,0,17) pos+=bits[x]*(1<<x);
	
	vector<int> stk;
	rep(x,0,pos+1) stk.pub(x);
	rep(x,pos+1,n){
		if (bits[x+17]){
			while (stk.back()!=pos){
				Remove(stk.back());
				stk.pob();
			}
			Remove(x);
		}
		else{
			stk.pub(x);
		}
	}
	
	rep(x,0,sz(stk)) Remove(stk[x]);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 580 KB Output is correct
2 Correct 1 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 1 ms 488 KB Output is correct
5 Correct 1 ms 488 KB Output is correct
6 Correct 1 ms 488 KB Output is correct
7 Correct 1 ms 496 KB Output is correct
8 Correct 2 ms 468 KB Output is correct
9 Correct 1 ms 492 KB Output is correct
10 Correct 2 ms 496 KB Output is correct
11 Correct 1 ms 488 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 63 ms 8640 KB Partially correct
2 Partially correct 68 ms 8672 KB Partially correct
3 Partially correct 64 ms 8668 KB Partially correct
4 Partially correct 67 ms 8616 KB Partially correct
5 Partially correct 68 ms 8604 KB Partially correct
6 Partially correct 64 ms 8580 KB Partially correct
7 Partially correct 66 ms 8540 KB Partially correct
8 Partially correct 68 ms 8468 KB Partially correct
9 Partially correct 63 ms 8584 KB Partially correct
10 Partially correct 63 ms 8592 KB Partially correct
11 Partially correct 73 ms 8580 KB Partially correct
12 Partially correct 67 ms 8588 KB Partially correct
13 Partially correct 72 ms 8748 KB Partially correct
14 Partially correct 81 ms 8548 KB Partially correct
15 Partially correct 71 ms 8692 KB Partially correct
16 Partially correct 69 ms 8636 KB Partially correct
17 Partially correct 70 ms 8764 KB Partially correct
18 Partially correct 78 ms 8764 KB Partially correct
19 Partially correct 71 ms 8604 KB Partially correct
20 Partially correct 62 ms 8700 KB Partially correct
21 Partially correct 65 ms 8596 KB Partially correct
22 Partially correct 74 ms 8796 KB Partially correct
23 Partially correct 62 ms 8620 KB Partially correct
24 Partially correct 64 ms 8740 KB Partially correct
25 Partially correct 71 ms 8704 KB Partially correct
26 Partially correct 70 ms 8788 KB Partially correct
27 Partially correct 70 ms 8724 KB Partially correct
28 Partially correct 69 ms 8804 KB Partially correct
29 Partially correct 71 ms 8856 KB Partially correct
30 Partially correct 70 ms 8796 KB Partially correct
31 Partially correct 72 ms 8836 KB Partially correct
32 Partially correct 64 ms 8592 KB Partially correct
33 Partially correct 64 ms 8540 KB Partially correct