結果
| 問題 | No.3211 NAND Oracle |
| コンテスト | |
| ユーザー |
のらら
|
| 提出日時 | 2025-07-26 00:03:19 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ac-library) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,105 bytes |
| 記録 | |
| コンパイル時間 | 2,894 ms |
| コンパイル使用メモリ | 262,936 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-13 13:46:40 |
| 合計ジャッジ時間 | 7,548 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
のらら