제출 #798399

#제출 시각아이디문제언어결과실행 시간메모리
798399NothingXDAncient Machine (JOI21_ancient_machine)C++17
30 / 100
1287 ms12780 KiB
/* 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]); } for (int i = 0; i < n; i++){ debug(s[i]); if (s[i] == 'X'){ Send(0); Send(0); } if (s[i] == 'Y'){ Send(0); Send(1); } if (s[i] == 'Z'){ Send(1); 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; for (int i = 1; i < L; i += 2){ if (A[i-1] == 0 && A[i] == 0) s.push_back('X'); if (A[i-1] == 0 && A[i] == 1) s.push_back('Y'); if (A[i-1] == 1 && A[i] == 0) s.push_back('Z'); debug(s.back()); } debug(s.size()); vector<int> v; for (int i = 0; i < n; i++){ if (v.empty() && s[i] == 'X'){ v.push_back(i); } else if (v.empty()){ Remove(i); } else{ if (s[i] != 'Z'){ 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(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...