QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#419023#4633. Coprime MatricesxyqwqWA 1ms3684kbC++14949b2024-05-23 17:03:062024-05-23 17:03:07

Judging History

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

  • [2024-05-23 17:03:07]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3684kb
  • [2024-05-23 17:03:06]
  • 提交

answer

//3E_qoj4633
#include<bits/stdc++.h>
using namespace std;

#ifndef ONLINE_JUDGE
ifstream fin("din.in");
ofstream fout("dout.out");
#define cin fin
#define cout fout
#endif

const int NUM=305;

int n,m,x,y,w;
int a[NUM][NUM];

signed main()
{
  ios::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);

  cin>>n>>m>>x>>y>>w;
  int t=1,num=n*m;
  for(int i=1;i<=m;i+=2)
  {
    if(i!=m)
    {
      for(int j=1;j<=n;++j)
      {
        if(j&1)
        {
          a[j][i]=t;
          a[j][i+1]=t+1;
          t+=2;
        }
        else
        {
          a[j][i+1]=t;
          a[j][i]=t+1;
          t+=2;
        }
      }
    }
    else
    {
      for(int j=1;j<=n;++j)
      {
        a[j][i]=t;
        ++t;
      }
    }
  }
  cout<<"Yes\n";
  for(int i=1;i<=n;++i)
  {
    for(int j=1;j<=m;++j)
      cout<<(a[i][j]-a[x][y]+w-1+num)%num+1<<" ";
    cout<<'\n';
  }

  return 0; 
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3684kb

input:

3 3 2 1 3

output:

Yes
9 1 6 
3 2 7 
4 5 8 

result:

wrong output format Expected EOLN