結果
問題 |
No.3211 NAND Oracle
|
ユーザー |
|
提出日時 | 2025-07-26 08:37:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 915 bytes |
コンパイル時間 | 2,255 ms |
コンパイル使用メモリ | 194,884 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-07-26 08:37:28 |
合計ジャッジ時間 | 5,340 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#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; cin >> 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; }