# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
466364 |
2021-08-19T02:12:09 Z |
Namnamseo |
None (JOI16_memory2) |
C++17 |
|
1 ms |
332 KB |
#include "Memory2_lib.h"
#include <vector>
#include <set>
#include <map>
using namespace std;
bool chk[100][100];
int ret[100][100];
int flip(int a,int b){
if(a>b) swap(a, b);
int& ret=::ret[a][b];
if(chk[a][b]) return ret;
chk[a][b]=1;
return ret = Flip(a, b);
}
void Solve(int T, int n){
set<int> mxpt;
mxpt.insert(0);
mxpt.insert(1);
vector<vector<int>> ans(n);
for(int i=2; i<2*n; ++i){
mxpt.insert(i);
vector<int> pts(mxpt.begin(), mxpt.end());
int k=pts.size();
set<int> vars[k];
set<int> szs;
for(int a=0; a<k; ++a){
for(int b=0; b<k; ++b) if(a!=b){
vars[a].insert(flip(pts[a], pts[b]));
}
szs.insert(vars[a].size());
}
if(szs.size() == 1){
continue;
}
mxpt.clear();
for(int a=0; a<k; ++a){
if(vars[a].size() != 1u) mxpt.insert(pts[a]);
else ans[*vars[a].begin()].push_back(pts[a]);
}
}
int a=*mxpt.begin(), b=*--mxpt.end();
ans[flip(a,b)].push_back(a);
ans[flip(a,b)].push_back(b);
for(int i=0; i<n; ++i){
Answer(ans[i][0], ans[i][1], i);
}
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
292 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
288 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
288 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |