답안 #798408

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
798408 2023-07-30T16:48:05 Z NothingXD Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
64 ms 8360 KB
/*
High hopes and noble endeavors...
Will shine with all the twinkling stars.
We hold you next to us...
The galaxy, so glorious.
We'll build with all of our dreams...
A new world that bravely gleams.
Char is fighting for our prayers!
Char is fighting for our prayers!
*/
#include "Anna.h"
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef complex<double> point;


namespace {

	void debug_out(){cerr << endl;}

	template<typename Head, typename... Tail>
		void debug_out(Head H, Tail... T){
			cerr << H << ' ';
			debug_out(T...);
		}

#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)

	const int maxn = 1e5 + 10;
	int n;
	string s;
}

void Anna(int N, std::vector<char> S) {
	n = N;
	for (int i = 0; i < n; i++){
		s.push_back(S[i]);
	}
	vector<int> v;
	for (int i = 0; i < n; i++){
		if (v.empty() && s[i] == 'X'){
			Send(1);
			v.push_back(i);
		}
		else if (v.empty()){
			Send(0);
		}
		else{
			if (s[i] != 'Z'){
				v.push_back(i);
				Send(1);
			}
			else{
				while(v.size() > 1){
					v.pop_back();
				}
				Send(0);
			}
		}
	}
}
/*
High hopes and noble endeavors...
Will shine with all the twinkling stars.
We hold you next to us...
The galaxy, so glorious.
We'll build with all of our dreams...
A new world that bravely gleams.
Char is fighting for our prayers!
Char is fighting for our prayers!
*/

#include "Bruno.h"
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef complex<double> point;

namespace {

	void debug_out(){cerr << endl;}

	template<typename Head, typename... Tail>
		void debug_out(Head H, Tail... T){
			cerr << H << ' ';
			debug_out(T...);
		}

#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)

	const int maxn = 1e5 + 10;
	int n;
	string s;
}

void Bruno(int N, int L, std::vector<int> A) {
	n = N;
	vector<int> v;
	for (int i = 0; i < n; i++){
		if (v.empty()){
			if (A[i] == 0){
				Remove(i);
			}
			else{
				v.push_back(i);
			}
		}
		else{
			if (A[i] == 1){
				v.push_back(i);
			}
			else{
				while(v.size() > 1){
					Remove(v.back());
					v.pop_back();
				}
				Remove(i);
			}
		}
	}
	while(!v.empty()){
		Remove(v.back());
		v.pop_back();
	}
}

Compilation message

Anna.cpp:25:7: warning: 'void {anonymous}::debug_out()' defined but not used [-Wunused-function]
   25 |  void debug_out(){cerr << endl;}
      |       ^~~~~~~~~

Bruno.cpp:25:7: warning: 'void {anonymous}::debug_out()' defined but not used [-Wunused-function]
   25 |  void debug_out(){cerr << endl;}
      |       ^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 0 ms 516 KB Output is correct
4 Correct 0 ms 516 KB Output is correct
5 Correct 0 ms 516 KB Output is correct
6 Correct 0 ms 516 KB Output is correct
7 Correct 1 ms 516 KB Output is correct
8 Correct 0 ms 508 KB Output is correct
9 Correct 1 ms 504 KB Output is correct
10 Correct 0 ms 508 KB Output is correct
11 Correct 0 ms 508 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 40 ms 7836 KB Partially correct
2 Partially correct 46 ms 7816 KB Partially correct
3 Partially correct 39 ms 7808 KB Partially correct
4 Partially correct 46 ms 7968 KB Partially correct
5 Partially correct 45 ms 7896 KB Partially correct
6 Partially correct 39 ms 7848 KB Partially correct
7 Partially correct 39 ms 7884 KB Partially correct
8 Partially correct 51 ms 7920 KB Partially correct
9 Partially correct 39 ms 7796 KB Partially correct
10 Partially correct 41 ms 7908 KB Partially correct
11 Partially correct 46 ms 7860 KB Partially correct
12 Partially correct 39 ms 7872 KB Partially correct
13 Partially correct 53 ms 8360 KB Partially correct
14 Partially correct 44 ms 7804 KB Partially correct
15 Partially correct 41 ms 7840 KB Partially correct
16 Partially correct 41 ms 7888 KB Partially correct
17 Partially correct 45 ms 8280 KB Partially correct
18 Partially correct 43 ms 7996 KB Partially correct
19 Partially correct 64 ms 7812 KB Partially correct
20 Partially correct 38 ms 7900 KB Partially correct
21 Partially correct 39 ms 7888 KB Partially correct
22 Partially correct 47 ms 8324 KB Partially correct
23 Partially correct 38 ms 7892 KB Partially correct
24 Partially correct 40 ms 7840 KB Partially correct
25 Partially correct 46 ms 7864 KB Partially correct
26 Partially correct 53 ms 8360 KB Partially correct
27 Partially correct 49 ms 7828 KB Partially correct
28 Partially correct 46 ms 8260 KB Partially correct
29 Partially correct 52 ms 7864 KB Partially correct
30 Partially correct 45 ms 7900 KB Partially correct
31 Partially correct 45 ms 7936 KB Partially correct
32 Partially correct 40 ms 7996 KB Partially correct
33 Partially correct 39 ms 7896 KB Partially correct