結果

問題 No.3211 NAND Oracle
ユーザー jiangxinyang
提出日時 2025-07-26 08:23:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 896 bytes
コンパイル時間 1,938 ms
コンパイル使用メモリ 193,476 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-07-26 08:23:26
合計ジャッジ時間 5,193 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 9 WA * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:7: warning: ‘k’ is used uninitialized [-Wuninitialized]
   13 |     k -= 2;
      |     ~~^~~~
main.cpp:12:12: note: ‘k’ was declared here
   12 |     int n, k;
      |            ^
main.cpp:14:11: warning: ‘n’ is used uninitialized [-Wuninitialized]
   14 |     if (n / 2 > k) {
      |         ~~^~~
main.cpp:12:9: note: ‘n’ was declared here
   12 |     int n, k;
      |         ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const int N = 200005;
const int INF = 0x3f3f3f3f;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    k -= 2;
    if (n / 2 > k) {
        if (k < 3) {
            cout << "No\n";
        } else {
            cout << "Yes\n";
            cout << "1 2\n";
            cout << "1 2\n";
            cout << "3 4\n";
            cout << "4 5\n";
            cout << "4 5\n";
            n -= 5;
            while (n--) cout << "6 7\n";
        }
    } else {
        cout << "Yes\n";
        cout << "1 2\n";
        n--;
        if (n) {
            cout << "1 2\n";
            n--;
        }
        while (n) {
            cout << "3 4\n";
            n--;
            if (!n) break;
            cout << "1 2\n";
            n--;
        }
    }
    return 0;
}
0