Submission #708219

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7082192023-03-11 10:26:30happypotatoMemory 2 (JOI16_memory2)C++17
100 / 100
1 ms372 KiB
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
int buff[101][101];
int ans[101];
int ask(int x, int y) {
if (buff[x][y] != -1) return buff[x][y];
return buff[x][y] = buff[y][x] = Flip(x, y);
}
int add(vector<int> &v) {
for (int i = 0; i < 4; i++) {
int cnt = 0;
for (int j = 0; j < 4; j++) {
if (i == j) continue;
cnt += (ask(v[i], v[j]) == ask(v[i], (i == 0 ? v[1] : v[0])));
}
if (cnt == 3) {
ans[v[i]] = ask(v[i], (i == 0 ? v[1] : v[0]));
return i;
}
}
return -1;
}
void Solve(int T, int n){
for (int i = 0; i < 2 * n; i++) {
for (int j = 0; j < 2 * n; j++) {
buff[i][j] = -1;
}
}
vector<int> v = {0, 1, 2, 3};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...