QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#380578#7178. Bishopsucup-team992#WA 0ms3556kbC++231.3kb2024-04-07 06:08:292024-04-07 06:08:30

Judging History

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

  • [2024-04-07 06:08:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3556kb
  • [2024-04-07 06:08:29]
  • 提交

answer

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

#define F first
#define S second
#define ar arry
typedef int uci;
#define int long long
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void solve(){

    int N, M; cin >> N >> M;
    vector<pii> out;
    vi col, row;

    for(int i = 0; i < N+M-1; i++) {
        if(i == 0) { out.push_back({0,0}); continue; }
        if(i < N) col.push_back(i);
        if(i  < M) {
            if(i == M-1 && M==N) {
                ;
            } else {
                row.push_back(i);
            }
        } 

        if(i < N) goto dcol;
        if(i < M) goto drow;
        if(col.size()) {
            dcol:
            out.push_back({col.back()+i-col.back(), i-col.back()}); col.pop_back();
        } else if(row.size()) {
            drow:
            out.push_back({i-row.back(), row.back()+i-row.back()}); row.pop_back();
        }
    }

    cout << out.size() << endl;
    for(auto xy: out) cout << xy.first+1 << " " << xy.second+1 << endl;

}

uci main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    solve();
}

詳細信息

Test #1:

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

input:

2 5

output:

6
1 1
2 1
1 3
1 4
1 5
5 6

result:

wrong answer Integer parameter [name=x] equals to 5, violates the range [1, 2]