QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#619985#4633. Coprime Matricesship2077WA 0ms3908kbC++23493b2024-10-07 16:13:252024-10-07 16:13:25

Judging History

你现在查看的是最新测评结果

  • [2024-10-07 16:13:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3908kb
  • [2024-10-07 16:13:25]
  • 提交

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