# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1071630 | 2024-08-23T09:28:12 Z | 정민찬(#11138) | Ancient Machine (JOI21_ancient_machine) | C++17 | 43 ms | 9144 KB |
#include "Anna.h" #include <bits/stdc++.h> using namespace std; void Send(int a); void Remove(int d); void mySend(vector<int> v) { for (auto &x : v) { Send(x); } } void Anna(int N, vector<char> S) { int x = -1, z = -1; for (int i=0; i<N; i++) { if (S[i] == 'X') { x = i; break; } } for (int i=N-1; i>=0; i--) { if (S[i] == 'Z') { z = i; break; } } if (x == -1 || z == -1 || x > z) { return; } for (int i=0; i<=13; i++) { Send(bool(x & (1<<i))); } for (int i=0; i<=13; i++) { Send(bool(z & (1<<i))); } vector<int> A; for (int i=x; i<z; i++) { if (S[i] == 'X') { A.push_back(1); i ++; } else { A.push_back(0); } } mySend(A); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 784 KB | Output is correct |
2 | Correct | 0 ms | 796 KB | Output is correct |
3 | Correct | 0 ms | 796 KB | Output is correct |
4 | Correct | 0 ms | 788 KB | Output is correct |
5 | Correct | 0 ms | 796 KB | Output is correct |
6 | Correct | 1 ms | 784 KB | Output is correct |
7 | Correct | 0 ms | 796 KB | Output is correct |
8 | Correct | 0 ms | 784 KB | Output is correct |
9 | Correct | 0 ms | 796 KB | Output is correct |
10 | Correct | 0 ms | 796 KB | Output is correct |
11 | Correct | 0 ms | 784 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 43 ms | 9144 KB | Wrong Answer [6] |
2 | Halted | 0 ms | 0 KB | - |