結果

問題 No.1519 Diversity
ユーザー 👑 CleyL
提出日時 2023-06-22 11:11:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 887 ms
コンパイル使用メモリ 74,036 KB
最終ジャッジ日時 2025-02-15 00:06:58
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

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