QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#223796#7178. BishopsHabitusWA 0ms3612kbC++141.7kb2023-10-22 17:16:342023-10-22 17:16:34

Judging History

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

  • [2023-10-22 17:16:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2023-10-22 17:16:34]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

int n, m;
bool zam;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin >> n >> m;
    if(n<m) {
        swap(n, m);
        zam=1;
    }
    if(m%2==1 && m<n) {
        cout << m+n-1 << "\n";
        for(int i=1; i<=m; i++) {
            if(zam) cout << i << ' ' << 1 << "\n" << i << ' ' << n << "\n";
            else cout << 1 << ' ' << i << "\n" << n << ' ' << i << "\n";
        }
        for(int i=m/2+2; i<=n-m/2-1; i++) {
            if(zam) cout << m/2+1 << ' ' << i << "\n";
            else cout << i << ' ' << m/2+1 << "\n";
        }
    }
    else if(m==n) {
        cout << m+n-2 << "\n";
        for(int i=1; i<=m; i++) {
            cout << 1 << ' ' << i << "\n";
        }
        for(int i=2; i<m; i++) {
            cout << n << ' ' << i << "\n";
        }
    }
    else if(n%2==1) {
        cout << m+n-1 << "\n";
        for(int i=1; i<=m; i++) {
            if(zam) cout << i << ' ' << 1 << "\n" << i << ' ' << n << "\n";
            else cout << 1 << ' ' << i << "\n" << n << ' ' << i << "\n";
        }
        for(int i=m/2+2; i<=n-m/2-1; i+=2) {
            if(zam) cout << m/2+1 << ' ' << i << "\n";
            else cout << i << ' ' << m/2+1 << "\n";
        }
    }
    else {
        cout << m+n-2 << "\n";
        for(int i=1; i<=m; i++) {
            if(zam) cout << i << ' ' << 1 << "\n" << i << ' ' << n << "\n";
            else cout << 1 << ' ' << i << "\n" << n << ' ' << i << "\n";
        }
        for(int i=m/2+2; i<=n-m/2-1; i+=2) {
            if(zam) cout << m/2+1 << ' ' << i << "\n";
            else cout << i << ' ' << m/2+1 << "\n";
        }
    }
}

詳細信息

Test #1:

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

input:

2 5

output:

6
1 1
1 5
2 1
2 5
2 3

result:

wrong output format Unexpected end of file - int32 expected