# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
821099 | ono_de206 | Ancient Machine 2 (JOI23_ancient2) | C++17 | 105 ms | 692 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ancient2.h"
#include<bits/stdc++.h>
using namespace std;
#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second
//#define int long long
typedef long long ll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
int ask(vector<int> a, vector<int> b) {
return Query((int)a.size(), a, b);
}
string Solve(int n) {
vector<int> a, b;
int l = 0;
string ans = "";
auto getNext = [&]() -> char {
int m = (int)a.size();
a.pb(m + 2);
b.pb(m + 1);
for(int i = 0; i < 2; i++) {
a.pb(m + i + 1);
b.pb(m + i + 1);
}
int ret = ask(a, b);
for(int i = 0; i < 3; i++) {
a.pop_back();
b.pop_back();
}
return (ret == m + 2 ? '0' : '1');
};
for(int i = 0; i < n; i++) {
ans.pb(getNext());
a.pb(i + 1);
b.pb(i + 1);
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |