QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#756686 | #8041. Life is Hard and Undecidable, but... | moon | WA | 0ms | 3624kb | C++14 | 800b | 2024-11-16 21:33:25 | 2024-11-16 21:33:26 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n;
cin >> n;
if(n == 1) {
cout << "1\n";
cout << "1 1\n";
return ;
// } else if(n == 2) {
// cout << "3\n";
// cout << "1 1\n2 1\n3 0\n";
} else {
cout << n + 1 << '\n';
for(int i = 1; i <= (n + 1) / 2; i++) {
cout << i << ' ' << i << '\n';
cout << i + 1 << ' ' << i << '\n';
}
if((n + 1) & 1) {
cout << n / 2 + 1 << ' ' << n / 2 + 1 << '\n';
}
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t = 1;
// cin >> t;
while(t--) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3508kb
input:
1
output:
1 1 1
result:
ok n=1
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3624kb
input:
2
output:
3 1 1 2 1 2 2
result:
wrong answer Alive at generation 2