結果

問題 No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
ユーザー nyya
提出日時 2022-06-17 22:41:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 1,720 ms
コンパイル使用メモリ 166,284 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 08:57:43
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 46 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){

    int n,k;
    cin >> n >> k;

    if(n > 2*k){
        cout << -1 << endl;
    } else {

        cout << k+2*(n-k) << endl;
        for(int i=1;i<=k;i++){
            cout << i+1 << " " << i+1 << endl;
        }
        for(int i=k+1;i<=n;i++){
            cout << i-k << " " << i << endl;
            cout << i << " " << i-k << endl;
        }
    }

    return 0;
}
0