QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#335139 | #7178. Bishops | coolplum | WA | 0ms | 3584kb | C++17 | 609b | 2024-02-22 19:27:17 | 2024-02-22 19:27:18 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n;
vector<pair<int, int> > h, v;
cin >> m >> n;
for (int i=0; i<m; i=i+n)
for (int j=0; j<n; j++)
h.push_back({i+1, j+1});
for (int j=0; j<n; j=j+m)
for (int i=0; i<m; i++)
v.push_back({i+1, j+1});
cout << max(h.size(), v.size()) << '\n';
if (h.size()>v.size())
for (auto x : h)
cout << x.first << ' ' << x.second << '\n';
else
for (auto x : v)
cout << x.first << ' ' << x.second << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
2 5
output:
6 1 1 2 1 1 3 2 3 1 5 2 5
result:
ok n: 2, m: 5, bishops: 6
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3460kb
input:
5 5
output:
5 1 1 2 1 3 1 4 1 5 1
result:
wrong answer Participant's answer is not optimal (5 < 8)