# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
772920 | 2023-07-04T12:56:10 Z | fve5 | 식물 비교 (IOI20_plants) | C++17 | 4000 ms | 18112 KB |
#include <bits/stdc++.h> using namespace std; #define MAXN 200'000 vector<int> adj[MAXN]; void init(int k, vector<int> r) { for (int i = 0; i < r.size(); i++) { if (r[i] == k - 1) { for (int j = 1; j < k; j++) { adj[(i + j) % r.size()].push_back(i); } } if (r[i] == 0) { for (int j = 1; j < k; j++) { adj[i].push_back((i + j) % r.size()); } } } } int compare_plants(int x, int y) { { set<int> visited; stack<int> q; q.push(x); while (!q.empty()) { auto curr = q.top(); q.pop(); if (visited.count(curr)) continue; if (curr == y) return 1; visited.insert(curr); for (auto n: adj[curr]) { q.push(n); } } } { set<int> visited; stack<int> q; q.push(y); while (!q.empty()) { auto curr = q.top(); q.pop(); if (visited.count(curr)) continue; if (curr == x) return -1; visited.insert(curr); for (auto n: adj[curr]) { q.push(n); } } } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4948 KB | Output is correct |
2 | Correct | 2 ms | 4948 KB | Output is correct |
3 | Correct | 3 ms | 4948 KB | Output is correct |
4 | Correct | 2 ms | 4948 KB | Output is correct |
5 | Correct | 3 ms | 4948 KB | Output is correct |
6 | Correct | 77 ms | 8708 KB | Output is correct |
7 | Correct | 1894 ms | 10672 KB | Output is correct |
8 | Correct | 247 ms | 17688 KB | Output is correct |
9 | Correct | 1899 ms | 17972 KB | Output is correct |
10 | Execution timed out | 4077 ms | 18112 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4996 KB | Output is correct |
2 | Correct | 3 ms | 4948 KB | Output is correct |
3 | Incorrect | 2 ms | 4948 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4996 KB | Output is correct |
2 | Correct | 3 ms | 4948 KB | Output is correct |
3 | Incorrect | 2 ms | 4948 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4988 KB | Output is correct |
2 | Incorrect | 2 ms | 4948 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4948 KB | Output is correct |
2 | Correct | 2 ms | 4948 KB | Output is correct |
3 | Correct | 2 ms | 4948 KB | Output is correct |
4 | Incorrect | 2 ms | 4948 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4948 KB | Output is correct |
2 | Correct | 2 ms | 5000 KB | Output is correct |
3 | Correct | 2 ms | 4948 KB | Output is correct |
4 | Incorrect | 2 ms | 4948 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4948 KB | Output is correct |
2 | Correct | 2 ms | 4948 KB | Output is correct |
3 | Correct | 3 ms | 4948 KB | Output is correct |
4 | Correct | 2 ms | 4948 KB | Output is correct |
5 | Correct | 3 ms | 4948 KB | Output is correct |
6 | Correct | 77 ms | 8708 KB | Output is correct |
7 | Correct | 1894 ms | 10672 KB | Output is correct |
8 | Correct | 247 ms | 17688 KB | Output is correct |
9 | Correct | 1899 ms | 17972 KB | Output is correct |
10 | Execution timed out | 4077 ms | 18112 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |