QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#619985 | #4633. Coprime Matrices | ship2077 | WA | 0ms | 3908kb | C++23 | 493b | 2024-10-07 16:13:25 | 2024-10-07 16:13:25 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int M=505;
int n,m,k,x,y,w,idx,a[M][M];
void update(int x,int y){if (x<=n&&y<=m) a[x][y]=++idx;}
int main(){
scanf("%d%d%d%d%d",&n,&m,&x,&y,&w);k=n*m;
for (int i=1;i<=n;i+=2)
for (int j=1;j<=m;j+=2)
update(i,j),update(i+1,j),update(i+1,j+1),update(i,j+1);
for (int i=1;i<=n;i++)
for (int j=1;j<=m;j++)
printf("%d%c",(a[i][j]+(k+w-a[x][y])-1)%k+1," \n"[j==m]);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3908kb
input:
3 3 2 1 3
output:
2 5 6 3 4 7 8 9 1
result:
wrong answer First Line not Yes