QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#693021 | #7075. Let's Play Jigsaw Puzzles! | ucup-team4352# | WA | 2ms | 11904kb | C++23 | 584b | 2024-10-31 15:23:21 | 2024-10-31 15:23:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
int m,n[maxn],s[maxn],w[maxn],e[maxn];
int ans[1005][1005];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin>>m;
int p=0;
for(int i=1;i<=m*m;++i) {
cin>>n[i]>>s[i]>>w[i]>>e[i];
if(n[i]==-1&&w[i]==-1) p=i;
}
ans[1][1]=p;
for(int i=1;i<=m;++i) {
for(int j=1;j<=m;++j) {
int p=ans[i][j];
if(s[p]!=-1) ans[i+1][j]=s[p];
if(e[p]!=-1) ans[i][j+1]=e[p];
cout<<ans[i][j]<<' ';
}
cout<<'\n';
}
return 0;
}/*
2
-1 3 -1 2
-1 4 1 -1
1 -1 -1 4
2 -1 3 -1
*/
詳細信息
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 11904kb
input:
2 -1 3 -1 2 -1 4 1 -1 1 -1 -1 4 2 -1 3 -1
output:
1 2 3 4
result:
wrong answer 1st lines differ - expected: '1 2', found: '1 2 '