結果
問題 | No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例 |
ユーザー |
![]() |
提出日時 | 2022-06-17 22:28:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 1,633 ms |
コンパイル使用メモリ | 166,216 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 08:39:10 |
合計ジャッジ時間 | 5,713 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 42 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; cin >> n >> k; if(k==0){ 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; }