結果

問題 No.1519 Diversity
ユーザー aspiaspi
提出日時 2021-05-26 00:13:21
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 2,180 ms
コンパイル使用メモリ 197,036 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 08:38:54
合計ジャッジ時間 3,309 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 29 ms
5,376 KB
testcase_04 AC 62 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 77 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 11 ms
5,376 KB
testcase_09 AC 29 ms
5,376 KB
testcase_10 AC 58 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 78 ms
5,376 KB
testcase_13 AC 79 ms
5,376 KB
testcase_14 AC 78 ms
5,376 KB
testcase_15 AC 78 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define int long long
#define rep(i,n) for(int i=0; i<(int)(n); i++)

signed main(){
    int N,a=2,b;
    cin>>N;
    b=N+1;
  	vector<pair<int,int>>vec;
    while(a<b){
        for(int i=a; i<b; i++){
          vec.push_back(make_pair(a-1, i));
        }
        a++;
        b--;
    }
  cout<<vec.size()<<endl;
  for(auto p: vec){
    cout<<p.first<<" "<<p.second<<endl;
  }
}
0