QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#756691#8041. Life is Hard and Undecidable, but...moonWA 0ms3640kbC++14791b2024-11-16 21:34:472024-11-16 21:34:51

Judging History

This is the latest submission verdict.

  • [2024-11-16 21:34:51]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3640kb
  • [2024-11-16 21:34:47]
  • 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 2\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: 3628kb

input:

1

output:

1
1 1

result:

ok n=1

Test #2:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

2

output:

3
1 1
2 1
3 2

result:

ok n=3

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3640kb

input:

3

output:

4
1 1
2 1
2 2
3 2

result:

wrong answer Alive at generation 3