結果
問題 | No.1519 Diversity |
ユーザー |
![]() |
提出日時 | 2021-04-25 23:37:08 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 88 ms / 2,000 ms |
コード長 | 844 bytes |
コンパイル時間 | 1,333 ms |
コンパイル使用メモリ | 162,616 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 16:00:24 |
合計ジャッジ時間 | 3,098 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h>template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}#define ll long long#define double long double#define rep(i,n) for(int i=0;i<(n);i++)#define REP(i,n) for(int i=1;i<=(n);i++)#define mod (ll)(1e9+7)#define inf (ll)(3e18+7)#define eps (double)(1e-9)#define pi (double) acos(-1)#define P pair<int,int>#define PiP pair<int,pair<int,int>>#define all(x) x.begin(),x.end()#define rall(x) x.rbegin(),x.rend()using namespace std;int main() {int n;cin >> n;vector<P> ans;REP(i, n){for(int j = i; j <= n-i; j++)ans.push_back({n-i+1, j});}cout << ans.size() << endl;for(auto x : ans)cout << x.first << " " << x.second << endl;}