QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#218317#7178. BishopsacagubicaWA 0ms3624kbC++141.1kb2023-10-17 23:51:362023-10-17 23:51:36

Judging History

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

  • [2023-10-17 23:51:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2023-10-17 23:51:36]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,m;
bool swaped=false;
vector<int>solx,soly;
void solveforodd(){
  if(m>=n+1){
    for(int i=1; i<=n; i++){
      solx.push_back(i);
      soly.push_back(1);
      solx.push_back(i);
      soly.push_back(m);
    }
    for(int j=n/2+2; j<=m-n/2-1; j++){
      solx.push_back(n/2+1);
      soly.push_back(j);
    }
    return;
  }
  if(m==1){
    solx.push_back(1);
    soly.push_back(1);
    return;
  }
  for(int i=1; i<=n; i++){
    solx.push_back(i);
    soly.push_back(1);
  }
  for(int i=2; i<=n-1; i++){
    solx.push_back(i);
    soly.push_back(m);
  }
  return;
}
int main(){

  cin>>n>>m;
  if(n>m){
    swap(n,m);
    swaped=true;
  }
  if(n%2==1)solveforodd();
  cout<<solx.size()<<"\n";
  if(swaped)swap(solx,soly);
  for(int i=0; i<solx.size(); i++)cout<<soly[i]<<" "<<solx[i]<<"\n";
  /*
  bool mat[105][105];
  for(int i=0; i<solx.size(); i++)mat[soly[i]][solx[i]]=true;
  */
  /*
  if(swaped)swap(n,m);
  for(int i=1; i<=m; i++){
    for(int j=1; j<=n; j++)
      cout<<mat[i][j]<<" ";
    cout<<endl;
  }
  */
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3624kb

input:

2 5

output:

0

result:

wrong answer Participant's answer is not optimal (0 < 6)