QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#116008 | #2043. Make a Sequence | NYCU_gAwr_gurA# | 0 | 7ms | 3420kb | C++14 | 1.5kb | 2023-06-27 21:44:26 | 2023-06-27 21:44:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
signed main() {
int n,m,p;
while((cin>>n>>m>>p) && n)
{
int arr[15][15][15]={}, nene[15][15]={};
int a,b,c,ans,aoi;
ans=aoi=0;
int j,x,y,z;
for(int i=0;i<p;i++)
{
cin>>a>>b;
c=++nene[a][b];
//cout<<" "<<i%2+1<<' '<<a<<' '<<b<<' '<<c<<endl;
arr[a][b][c]=i%2+1;
for(x=-1;x<=1;x++)
{
for(y=-1;y<=1;y++){
for(z=-1;z<=1;z++)
{
if(!x && !y && !z)
continue;
for(j=0;j<m-1;j++)
{
//cout<<"### "<<j<<endl;
if(a+j*x+x<1 || b+j*y+y<1 || c+j*z+z<1)
break;
//cout<<"ouooououuuou "<<j<<endl;
if(arr[a+j*x][b+j*y][c+j*z]!=arr[a+j*x+x][b+j*y+y][c+j*z+z])
break;
//cout<<"# "<<j<<endl;
}
if(j==m-1 && !ans)
ans=i%2+1, aoi=i+1;
}
}
}
}
if(ans==1)
cout<<"black"<<' '<<aoi<<endl;
else if(ans==2)
cout<<"white "<<aoi<<endl;
else
cout<<"draw"<<endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 7ms
memory: 3420kb
input:
3 3 3 1 1 1 1 1 1 3 3 14 1 1 2 2 3 2 3 1 1 3 1 2 1 3 1 3 2 3 3 3 1 2 1 1 3 1 3 1 3 3 5 1 1 1 3 2 1 2 3 3 1 3 3 5 1 1 3 1 1 2 3 2 1 3 3 3 5 1 1 2 2 1 1 2 2 1 1 3 3 5 1 1 3 1 2 2 3 2 3 3 3 3 5 3 1 1 1 2 2 1 2 1 3 3 3 7 1 1 2 1 2 1 3 1 1 1 3 1 3 1 3 3 7 3 1 2 1 2 1 1 1 3 1 1 1 1 1 3 3 7 1 1 1 2 1 2 1 3...
output:
draw draw black 5 black 5 black 5 black 5 black 5 black 7 black 7 black 7 black 7 black 7 black 7 black 7 black 7 black 7 black 7 black 7 black 7 black 11 black 11 black 11 black 11 black 11 black 11 black 11 black 11 black 11 black 11 black 13 black 13 white 8 black 11 black 7 white 22 white 10 whi...
result:
wrong answer 1st lines differ - expected: 'Draw', found: 'draw'