QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#357120 | #403. Memory2 | krzynkow134 | 100 ✓ | 1ms | 3868kb | C++14 | 3.0kb | 2024-03-18 18:27:52 | 2024-03-18 18:27:53 |
Judging History
answer
#include <bits/stdc++.h>
#include "Memory2_lib.h"
using namespace std;
struct que{
int i;
int j;
int x;
};
int ile[115][115];
int known[115];
int czy[115];
pair <int, int> ans[115];
vector <int> sus;
vector <que> queris;
int felipe(int i, int j){
/*int x;
cout << "FLIP: " << i << ' ' << j << '\n';
cin >> x;*/
int x=Flip(i, j);
return x;
}
void answ(int i, int j, int x){
//cout << "ANSWER: " << i << ' ' << j << ' ' << x << '\n';
Answer(i, j, x);
}
void Solve(int T, int N)
{
/*cout << "T N\n";
int T, N;
cin >> T >> N;*/
int t=T, n=N, i, j, a, b, x, fur=0, k;
for(i=0; i<2*n; i++){
known[i]=-1;
}
for(i=0; i<2*n; i++){
ans[i]={-1, -1};
if(known[i]==-1){
k=queris.size();
for(j=i+1; j<2*n; j++){
if(known[j]!=-1){
continue;
}
else{
x=felipe(i, j);
}
queris.push_back({i, j, x});
czy[x]++;
ile[i][x]++;
if(ile[i][x]>=3){
known[i]=x;
break;
}
}
if(j==2*n){
a=-1;
for(j=0; j<n; j++){
if(czy[j]==1){
a=j;
break;
}
}
if(a==-1){
for(j=k; j<queris.size(); j++){
if(queris[j].j==fur){
x=queris[j].x;
break;
}
}
a=-1;
b=-1;
for(j=k; j<queris.size(); j++){
if(queris[j].x==x){
if(a==-1){
a=queris[j].j;
}
else{
b=queris[j].j;
}
}
}
known[i]=x;
x=felipe(a, b);
known[a]=x;
known[b]=x;
}
else{
known[i]=a;
for(j=k; j<queris.size(); j++){
known[queris[j].j]=queris[j].x;
}
}
}
fur=max(fur, j);
for(j=k; j<queris.size(); j++){
if(queris[j].x!=known[i]){
known[queris[j].j]=queris[j].x;
}
}
}
}
for(i=0; i<2*n; i++){
if(ans[known[i]].first==-1){
ans[known[i]].first=i;
}
else{
ans[known[i]].second=i;
}
}
for(i=0; i<n; i++){
answ(ans[i].first, ans[i].second, i);
}
}
詳細信息
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 1ms
memory: 3784kb
Test #2:
score: 0
Accepted
time: 0ms
memory: 3824kb
Test #3:
score: 0
Accepted
time: 0ms
memory: 3816kb
Test #4:
score: 0
Accepted
time: 0ms
memory: 3828kb
Test #5:
score: 0
Accepted
time: 0ms
memory: 3724kb
Test #6:
score: 0
Accepted
time: 0ms
memory: 3796kb
Test #7:
score: 0
Accepted
time: 0ms
memory: 3744kb
Test #8:
score: 0
Accepted
time: 0ms
memory: 3832kb
Subtask #2:
score: 50
Accepted
Test #9:
score: 50
Accepted
time: 0ms
memory: 3744kb
Test #10:
score: 0
Accepted
time: 0ms
memory: 3860kb
Test #11:
score: 0
Accepted
time: 0ms
memory: 3844kb
Test #12:
score: 0
Accepted
time: 0ms
memory: 3804kb
Test #13:
score: 0
Accepted
time: 0ms
memory: 3724kb
Test #14:
score: 0
Accepted
time: 0ms
memory: 3816kb
Test #15:
score: 0
Accepted
time: 0ms
memory: 3816kb
Test #16:
score: 0
Accepted
time: 0ms
memory: 3852kb
Test #17:
score: 0
Accepted
time: 0ms
memory: 3776kb
Test #18:
score: 0
Accepted
time: 0ms
memory: 3808kb
Subtask #3:
score: 40
Accepted
Test #19:
score: 40
Accepted
time: 0ms
memory: 3868kb
Test #20:
score: 0
Accepted
time: 0ms
memory: 3832kb
Test #21:
score: 0
Accepted
time: 0ms
memory: 3824kb
Test #22:
score: 0
Accepted
time: 0ms
memory: 3736kb
Test #23:
score: 0
Accepted
time: 0ms
memory: 3788kb
Test #24:
score: 0
Accepted
time: 1ms
memory: 3748kb
Test #25:
score: 0
Accepted
time: 0ms
memory: 3868kb
Test #26:
score: 0
Accepted
time: 0ms
memory: 3840kb
Test #27:
score: 0
Accepted
time: 0ms
memory: 3800kb
Test #28:
score: 0
Accepted
time: 0ms
memory: 3804kb
Extra Test:
score: 0
Extra Test Passed