結果

問題 No.1519 Diversity
ユーザー CleyLCleyL
提出日時 2023-06-22 11:11:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 688 ms
コンパイル使用メモリ 74,668 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 05:52:29
合計ジャッジ時間 3,338 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 31 ms
4,380 KB
testcase_04 AC 67 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 88 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 34 ms
4,376 KB
testcase_10 AC 62 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 83 ms
4,376 KB
testcase_13 AC 91 ms
4,376 KB
testcase_14 AC 90 ms
4,376 KB
testcase_15 AC 89 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int n;cin>>n;
	int nw = n;
  vector<pair<int,int>> A;
	for(int i = 1; n >= i; i++){
		for(int j = i+1; nw >= j; j++){
      A.push_back({i,j});
		}
		nw--;
	}
  cout << A.size() << endl;
  for(int i = 0; A.size() > i; i++)cout << A[i].first << " " << A[i].second << endl;
}
0