QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#756686#8041. Life is Hard and Undecidable, but...moonWA 0ms3624kbC++14800b2024-11-16 21:33:252024-11-16 21:33:26

Judging History

This is the latest submission verdict.

  • [2024-11-16 21:33:26]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3624kb
  • [2024-11-16 21:33:25]
  • Submitted

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