結果
問題 |
No.3211 NAND Oracle
|
ユーザー |
![]() |
提出日時 | 2025-07-26 00:03:19 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,105 bytes |
コンパイル時間 | 3,876 ms |
コンパイル使用メモリ | 177,148 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-07-26 00:03:27 |
合計ジャッジ時間 | 6,650 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 8 |
ソースコード
#include <iostream> #include <algorithm> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; //#define endl "\n"; vector<pair<int, int>> ans = {{1, 2},{2,3},{1,4}}; int main(){ int Q, K; cin >> Q >> K; if(Q == 1){ if(K >= 2){ cout << "Yes" << endl; cout << ans[0].first << " " << ans[0].second << endl; return 0; }else{ cout << "No" << endl; return 0; } } if(Q == 2 || Q == 3){ if(K >= 3){ cout << "Yes" << endl; for(int i = 0; i < Q; i++) cout << ans[i].first << " " << ans[i].second << endl; return 0; }else{ cout << "No" << endl; return 0; } } if(Q >= 4){ int rest = Q - 3; if(K >= 3 + (rest + 1) / 2){ cout << "Yes" << endl; for(int i = 0; i < 3; i++) cout << ans[i].first << " " << ans[i].second << endl; for(int i = 0; i < rest; i++){ if(i % 2 == 0) cout << 3 << " " << 5 << endl; else cout << 1 << " " << 4 << endl; } return 0; }else{ cout << "No" << endl; return 0; } } return 0; }