# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1029423 | aguss | CATS (NOI14_cats) | C++14 | 1559 ms | 4428 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define sp " "
#define endl "\n"
#define f1(i, x) for(auto &i : x)
#define f2(i, x, n) for(int i = n; i < x; i++)
typedef long long ll;
using namespace std;
void push(deque<ll> &s, ll a){
if(a < 0){
f1(i, s) i ^= 1;
} else s.push_front(a);
}
void solve(){
ll x, l, n;
cin >> x >> l >> n;
deque<ll> s1, s2;
ll c = x;
ll f = 0;
while(c){
push(s2, s1.empty() ? f : s1.front());
if(s1.size()) s1.pop_front();
f1(i, s1){
i ^= 1;
f ^= 1;
}
if(s2.front() > l){
c--;
if(!c) cout << s2.front() << endl;
} else {
ll x = 2 * n + s2.front();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |