結果

問題 No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
ユーザー keisuke6keisuke6
提出日時 2022-06-17 22:02:23
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 547 bytes
コンパイル時間 4,695 ms
コンパイル使用メモリ 293,880 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 13:56:59
合計ジャッジ時間 16,672 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 48 ms
5,376 KB
testcase_04 AC 218 ms
5,376 KB
testcase_05 AC 114 ms
5,376 KB
testcase_06 AC 207 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 62 ms
5,376 KB
testcase_11 AC 63 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 3 ms
5,376 KB
testcase_14 AC 5 ms
5,376 KB
testcase_15 AC 250 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 242 ms
5,376 KB
testcase_19 AC 192 ms
5,376 KB
testcase_20 AC 188 ms
5,376 KB
testcase_21 AC 41 ms
5,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 62 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 3 ms
5,376 KB
testcase_30 AC 166 ms
5,376 KB
testcase_31 WA -
testcase_32 AC 57 ms
5,376 KB
testcase_33 AC 95 ms
5,376 KB
testcase_34 AC 214 ms
5,376 KB
testcase_35 AC 9 ms
5,376 KB
testcase_36 AC 73 ms
5,376 KB
testcase_37 AC 35 ms
5,376 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 2 ms
5,376 KB
testcase_45 WA -
testcase_46 AC 259 ms
5,376 KB
testcase_47 AC 334 ms
5,376 KB
testcase_48 AC 323 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N,K;
  cin>>N>>K;
  if(K == 0){
      cout<<-1<<endl;
      return 0;
  }
  cout<<K*K+2*(N-K)*K<<endl;
  for(int i=1;i<=K;i++) cout<<i<<' '<<i<<endl;
  for(int i=1;i<=K;i++)for(int j=1;j<=K;j++)if(i!=j) cout<<i<<' '<<j<<endl;
  for(int i=1;i<=K;i++)for(int j=K+1;j<=N;j++) cout<<i<<' '<<j<<endl;
  for(int i=K+1;i<=N;i++)for(int j=1;j<=K;j++) cout<<i<<' '<<j<<endl;
}
0