結果
問題 |
No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
|
ユーザー |
![]() |
提出日時 | 2022-06-17 22:19:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 1,661 ms |
コンパイル使用メモリ | 166,220 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 08:25:32 |
合計ジャッジ時間 | 5,549 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; cin >> n >> k; if(k==0 || k%2==1){ cout << -1 << endl; } else { cout << k+2*(n-k) << endl; for(int i=0;i<k;i++){ cout << i+1 << " " << i+1 << endl; } for(int i=k+1;i<=n;i++){ cout << k << " " << i << endl; cout << i << " " << k << endl; } } return 0; }