結果
問題 | No.5007 Steiner Space Travel |
ユーザー |
|
提出日時 | 2022-07-30 14:56:32 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 2,879 bytes |
コンパイル時間 | 2,048 ms |
実行使用メモリ | 3,604 KB |
スコア | 2,635,980 |
最終ジャッジ日時 | 2022-07-30 14:56:37 |
合計ジャッジ時間 | 3,737 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long; using ld = long double;using pll = pair<ll, ll>; using pld = pair<ld, ld>;using vll = vector<ll>; using vld = vector<ld>;using vpll = vector<pll>; using vpld = vector<pld>;using vvll = vector<vll>; using vvld = vector<vld>;template<class T> using min_queue = priority_queue<T, vector<T>, greater<T>>;template<class T> using max_queue = priority_queue<T, vector<T>, less<T>>;#define rep(i, a, b) for(ll i = (ll)a; i < (ll)b; i++)#define irep(i, v) for(auto i = (v).begin(); i != (v).end(); i++)#define SZ(v) (ll)(v).size()#define ALL(v) (v).begin(), (v).end()#define SHIFT(a) (1LL << (ll)a)#define endl '\n'const ll INF = 1e18;const ll MOD = 1e9 + 7;const ld EPS = 1e-10;const ld PI = M_PI;ll power(ll x, ll y){ ll res = 1; while(y > 0){ if(y & 1){ res *= x; } x *= x; y >>= 1; } return res; }bool in_grid(ll x, ll y, ll h, ll w){ return (0 <= x && x < h && 0 <= y && y < w); }template<class T> void pvec(vector<T> &vec){ for(ll i = 0; i < (ll)vec.size(); i++){ if(i){ cout << " "; } cout << vec[i]; } cout << endl; }template<class T> void pvvec(vector<vector<T>> &vec){ for(ll i = 0; i < (ll)vec.size(); i++){ for(ll j = 0; j < (ll)vec[i].size(); j++){ if(j){ cout<< " "; } cout << vec[i][j]; } cout << endl; } }template<class T> void asort(vector<T> &vec){ sort(ALL(vec)); }template<class T> void rsort(vector<T> &vec){ sort(ALL(vec)); reverse(ALL(vec)); }void pr(pll p){cout << p.first << " " << p.second << endl;}using ppll = pair<pll, ll>;bool comp1(ppll &p1, ppll &p2){return (p1.first.first < p2.first.first);}bool comp2(ppll &p1, ppll &p2){return (p1.first.first > p2.first.first);}//using mint = modint<MOD>;int main(){cin.tie(nullptr);ios::sync_with_stdio(false);srand((unsigned)time(NULL));cout << fixed << setprecision(20);ll n, m;cin >> n >> m;vpll vec(n);rep(i, 0, n) cin >> vec[i].first >> vec[i].second;vector<ppll> vec1, vec2, vec3, vec4;ll x = vec[0].first, y = vec[0].second;rep(i, 1, n){ll xp = vec[i].first, yp = vec[i].second;if(xp >= x && yp < y) vec1.push_back({vec[i], i + 1});if(xp > x && yp >= y) vec2.push_back({vec[i], i + 1});if(xp <= x && yp > y) vec3.push_back({vec[i], i + 1});if(xp < x && yp <= y) vec4.push_back({vec[i], i + 1});}sort(ALL(vec1), comp1);sort(ALL(vec2), comp2);sort(ALL(vec3), comp2);sort(ALL(vec4), comp1);rep(i, 0, m){pll t = {0, 0};pr(t);}ll v = n + 1;cout << v << endl;pr({1, 1});rep(i, 0, SZ(vec1)) cout << 1 << " " << vec1[i].second << endl;rep(i, 0, SZ(vec2)) cout << 1 << " " << vec2[i].second << endl;rep(i, 0, SZ(vec3)) cout << 1 << " " << vec3[i].second << endl;rep(i, 0, SZ(vec4)) cout << 1 << " " << vec4[i].second << endl;pr({1, 1});return 0;}