QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#356982 | #403. Memory2 | AdamGS | 100 ✓ | 1ms | 4064kb | C++23 | 1.3kb | 2024-03-18 16:56:54 | 2024-03-18 16:56:55 |
Judging History
answer
#include "Memory2_lib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int INF=1e9+7;
int T[107][107], odw[107][107];
int pyt(int a, int b) {
if(a>b) swap(a, b);
if(!odw[a][b]) {
odw[a][b]=1;
T[a][b]=Flip(a, b);
}
return T[a][b];
}
void Solve(int t, int n) {
if(n==1) {
Answer(0, 1, 0);
return;
}
vector<int>T(2*n);
vector<int>P={0, 1, 2};
for(int i=3; i<2*n; ++i) {
P.pb(i);
rep(j, P.size()) {
int ma=-INF, mi=INF;
rep(l, P.size()) if(l!=j) {
ma=max(ma, pyt(P[l], P[j]));
mi=min(mi, pyt(P[l], P[j]));
}
if(ma==mi) {
vector<int>V;
rep(l, P.size()) if(l!=j) V.pb(P[l]);
T[P[j]]=ma;
P=V;
break;
}
}
}
if(pyt(P[0], P[1])==pyt(P[0], P[2])) {
T[P[0]]=pyt(P[0], P[1]);
T[P[1]]=T[P[2]]=pyt(P[1], P[2]);
} else if(pyt(P[1], P[0])==pyt(P[1], P[2])) {
T[P[1]]=pyt(P[1], P[0]);
T[P[0]]=T[P[2]]=pyt(P[0], P[2]);
} else {
T[P[2]]=pyt(P[2], P[0]);
T[P[0]]=T[P[1]]=pyt(P[0], P[1]);
}
rep(i, 2*n) rep(j, i) if(T[i]==T[j]) Answer(i, j, T[i]);
}
詳細信息
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 1ms
memory: 3804kb
Test #2:
score: 0
Accepted
time: 0ms
memory: 3820kb
Test #3:
score: 0
Accepted
time: 0ms
memory: 3832kb
Test #4:
score: 0
Accepted
time: 1ms
memory: 4032kb
Test #5:
score: 0
Accepted
time: 1ms
memory: 3732kb
Test #6:
score: 0
Accepted
time: 1ms
memory: 3804kb
Test #7:
score: 0
Accepted
time: 1ms
memory: 4020kb
Test #8:
score: 0
Accepted
time: 0ms
memory: 4060kb
Subtask #2:
score: 50
Accepted
Test #9:
score: 50
Accepted
time: 1ms
memory: 3768kb
Test #10:
score: 0
Accepted
time: 1ms
memory: 3784kb
Test #11:
score: 0
Accepted
time: 0ms
memory: 3764kb
Test #12:
score: 0
Accepted
time: 0ms
memory: 3764kb
Test #13:
score: 0
Accepted
time: 1ms
memory: 3796kb
Test #14:
score: 0
Accepted
time: 1ms
memory: 4064kb
Test #15:
score: 0
Accepted
time: 1ms
memory: 3684kb
Test #16:
score: 0
Accepted
time: 0ms
memory: 3724kb
Test #17:
score: 0
Accepted
time: 0ms
memory: 3716kb
Test #18:
score: 0
Accepted
time: 1ms
memory: 3748kb
Subtask #3:
score: 40
Accepted
Test #19:
score: 40
Accepted
time: 0ms
memory: 4044kb
Test #20:
score: 0
Accepted
time: 1ms
memory: 3836kb
Test #21:
score: 0
Accepted
time: 1ms
memory: 3824kb
Test #22:
score: 0
Accepted
time: 0ms
memory: 3700kb
Test #23:
score: 0
Accepted
time: 0ms
memory: 3792kb
Test #24:
score: 0
Accepted
time: 1ms
memory: 3828kb
Test #25:
score: 0
Accepted
time: 0ms
memory: 3796kb
Test #26:
score: 0
Accepted
time: 0ms
memory: 3724kb
Test #27:
score: 0
Accepted
time: 1ms
memory: 3980kb
Test #28:
score: 0
Accepted
time: 0ms
memory: 3732kb
Extra Test:
score: 0
Extra Test Passed