| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 39829 | cheater2k | 고속도로 설계 (CEOI12_highway) | C++14 | 2 ms | 3264 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "office.h"
using namespace std;
int n, a, b, c;
int query(int x, int y, int z) {
  return isOnLine(x + 1, y + 1, z + 1);
}
void brute() {
  for (a = 0; a < 5; ++a) {
    for (b = a + 1; b < 5; ++b) {
      for (c = b + 1; c < 5; ++c) {
        if (!query(a, b, c)) continue;
        int x = 0;
        while(x == a || x == b || x == c) ++x;
        int y = 10 - a - b - x;
        Answer(a + 1, b + 1, x + 1, y + 1);
      }
    }
  }
}
void solve() {
  vector<int> line;
  vector<int> rem;
  for (int i = 0; i < n; ++i) if (i != a && i != b && i != c) rem.push_back(i);
  for (int i = 0; i < rem.size(); i += 2) {
    if (line.size() >= 2) break;
    int x = rem[i], y = (i == rem.size() - 1) ? b : rem[i + 1];
    if (query(a, x, y)) continue;
    if (!query(a, b, x)) {
      line.push_back(x);
    } else {
      line.push_back(y);
    }
  }
  assert(line.size() >= 2);
  Answer(a + 1, b + 1, line[0] + 1, line[1] + 1);
}
int main() {
  n = GetN();
  a = -1, b = -1, c = -1;
  int p = query(0, 1, 2);
  if (p) {
    a = 0; b = 1; c = 2; solve();
  }
  
  int q = query(2, 3, 4);
  if (q) {
    a = 2; b = 3; c = 4; solve();
  }
  
  brute();
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
