This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "key.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int ask(int a, int b){
static map<pii, int> mem;
if(a>b) swap(a,b);
if(mem.find(pii(a,b))!=mem.end()) return mem[pii(a,b)];
TakeKey(a); if(a!=b) TakeKey(b);
return mem[pii(a,b)]=Explore();
}
void EnsureKeyInfo(int n) {
for(int i=1; i<=n; i++) for(int j=1; j<=n; j++){
// cout<<ask(i,i)<<' '<<ask(i,j)<<'\n';
if(ask(i,i)==ask(i,j)) Report(i,j);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |