# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131524 | 2019-07-17T08:40:31 Z | MrTEK | Meetings (JOI19_meetings) | C++14 | 89 ms | 680 KB |
#include "meetings.h" #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair <int,int> ii; const int N = 3e2 + 5; vector <int> v; int mark[N][N],d[N][N]; void solve(vector <int> v) { if (v.size() < 2) return; if (v.size() == 2) { Bridge(v[0],v[1]); return; } // cerr << "Selam oyun baslasin : " << v[0] << endl; for (int i = 1 ; i < v.size() ; i++) { if (mark[v[0]][i]) continue; vector <int> nv; nv.push_back(i); mark[v[0]][i] = 1; for (int j = i + 1 ; j < v.size() ; j++) if (mark[v[0]][j] == 0) { int temp = Query(v[0],v[i],v[j]); if (temp != v[0]) { mark[v[0]][j] = 1; nv.push_back(j); if (temp != v[i]) d[v[0]][i] = 1; if (temp != v[j]) d[v[0]][j] = 1; } } // cerr << "yeni agac : " << v[0] << " " << v[i] << "\n"; vector <int> nv2; for (auto j : nv) { // cerr << v[j] << " "; if (d[v[0]][j] == 0) { // cerr << "HOLY BRIDGE " << v[0] << " " << v[j] << endl; Bridge(v[0],v[j]); } nv2.push_back(v[j]); } solve(nv2); } } void Solve(int n) { for (int i = 0 ; i < n ; i++) v.push_back(i); solve(v); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 248 KB | Output is correct |
4 | Incorrect | 2 ms | 248 KB | Wrong Answer [4] |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 248 KB | Output is correct |
4 | Incorrect | 2 ms | 248 KB | Wrong Answer [4] |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 248 KB | Output is correct |
4 | Incorrect | 2 ms | 248 KB | Wrong Answer [4] |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 89 ms | 680 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |