結果
問題 |
No.1519 Diversity
|
ユーザー |
|
提出日時 | 2021-06-21 11:47:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 84 ms / 2,000 ms |
コード長 | 620 bytes |
コンパイル時間 | 1,598 ms |
コンパイル使用メモリ | 169,420 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 22:49:24 |
合計ジャッジ時間 | 3,522 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 |
ソースコード
//#include <atcoder/all> #include <bits/stdc++.h> using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector<ll>; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector<vector<ll>>; Graph G; vll dist; vector<bool> seen; ll mod = 1e9 + 7; int main() { ll N; cin>>N; ll k=0; for(ll i=1;i<N;i++){ for(ll j=i+1;j<=N-i+1;j++){ k++; } } cout<<k<<endl; for(ll i=1;i<N;i++){ for(ll j=i+1;j<=N-i+1;j++){ cout<<i<<" "<<j<<endl; } } }