QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#380578 | #7178. Bishops | ucup-team992# | WA | 0ms | 3556kb | C++23 | 1.3kb | 2024-04-07 06:08:29 | 2024-04-07 06:08:30 |
Judging History
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();
}
Details
Tip: Click on the bar to expand more detailed information
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]