結果

問題 No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
ユーザー umezo
提出日時 2022-06-17 23:17:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 192,524 KB
最終ジャッジ日時 2025-01-29 22:37:41
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n,k;
  cin>>n>>k;
  
  int a=(n+1)/2;
  
  if(k<a){
    cout<<-1<<endl;
    return 0;
  }
  
  for(int i=1;i<=a;i++){
    cout<<i<<" "<<i<<endl;
    for(int j=i+1;j<=n;j++){
      cout<<i<<" "<<j<<endl;
      cout<<j<<" "<<i<<endl;
    }
  }
  
  return 0;
}
0