QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#590677 | #6668. Trokuti | zhenjianuo2025 | 0 | 35ms | 3908kb | C++14 | 2.5kb | 2024-09-26 09:58:21 | 2024-09-26 09:58:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define x first
#define y second
#define fi first
#define se second
#define ins insert
#define it iterator
#define lb lower_bound
#define ub upper_bound
#define exc(exp) if(exp)continue;
#define ret(exp) if(exp)return;
#define stop(exp) if(exp)break;
#define quit(sth) {sth;return;}
#define let(var...) int var;tie(var)
#define siz(vec) ((int)((vec).size()))
#define all(vec) (vec).begin(),(vec).end()
#define unq(vec) sort(all(vec)),(vec).erase(unique(all(vec)),(vec).end())
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define debl(var) cerr<<#var<<'='<<(var)<<";\n"
#define db double
#define ll long long
#define int long long
#define inf (long long)(1e18)
mt19937 gen(random_device{}());
bool Max(int &x,int y){if(x<y)return x=y,1;return 0;}
bool Min(int &x,int y){if(x>y)return x=y,1;return 0;}
const int mod=1e9+7;
void Add(int &x,int y){x=x+y<mod?x+y:x+y-mod;}
int add(int x,int y){return x+y<mod?x+y:x+y-mod;}
int fpm(int x,int y){
int ans=1;for(;y;y>>=1,(x*=x)%=mod)if(y&1)(ans*=x)%=mod;return ans;
}
int n=100,G[110][110],H[110][110];
int ask(int a,int b,int c){
cout<<"? "<<a<<' '<<b<<' '<<c<<endl;
cin>>a; return a;
}
int ask(int a,int b,int c,int d){
return (ask(a,b,d)+ask(a,b,c)-ask(c,a,d)-ask(c,b,d))/2;
}
void answ(int G[110][110]){
cout<<"! "<<endl;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++)cout<<G[i][j];cout<<endl;
}
}
void chk(){
for(int T=1;T<=100000;T++){
int u=gen()%n+1,v,w;
do v=gen()%n+1;while(u==v);
do w=gen()%n+1;while(u==w||v==w);
int s=ask(u,v,w);
if(G[u][v]+G[v][w]+G[w][u]!=s)return answ(G);
if(H[u][v]+H[v][w]+H[w][u]!=s)return answ(H);
} answ(G);
}
void work(){
H[1][2]=1;
for(int i=3;i<=n;i++){
for(int j=i+1;j<=n;j++){
G[i][j]=G[j][i]=G[1][2]+ask(i,j,1,2);
H[i][j]=H[j][i]=H[1][2]+ask(i,j,1,2);
}
}
for(int i=3;i<=n;i++){
int u=99,v=100;
if(i==99)u=98;
if(i==100)v=98;
G[1][i]=G[i][1]=G[u][v]+ask(1,i,u,v);
H[1][i]=H[i][1]=H[u][v]+ask(1,i,u,v);
}
chk();
}
signed main(){
int T=1;while(T--)work();
}
/*
* CONTINUE, NON-STOPPING, FOR THE FAITH
* START TYPING IF YOU DON'T KNOW WHAT TO DO
* STOP TYPING IF YOU DON'T KNOW WHAT YOU'RE DOING
*/
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 35ms
memory: 3908kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 3 4 2 ? 3 4 1 ? 1 3 2 ? 1 4 2 ? 3 4 2 ? 3 4 1 ? 1 3 2 ? 1 4 2 ? 3 5 2 ? 3 5 1 ? 1 3 2 ? 1 5 2 ? 3 5 2 ? 3 5 1 ? 1 3 2 ? 1 5 2 ? 3 6 2 ? 3 6 1 ? 1 3 2 ? 1 6 2 ? 3 6 2 ? 3 6 1 ? 1 3 2 ? 1 6 2 ? 3 7 2 ? 3 7 1 ? 1 3 2 ? 1 7 2 ? 3 7 2 ? 3 7 1 ? 1 3 2 ? 1 7 2 ? 3 8 2 ? 3 8 1 ? 1 3 2 ? 1 8 2 ? 3 8 2 ? 3 ...
result:
wrong answer the graph you report is incorrect