結果

問題 No.630 門松グラフ
ユーザー SugarDragon5SugarDragon5
提出日時 2018-01-05 22:25:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,126 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 165,892 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 20:54:58
合計ジャッジ時間 7,528 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,380 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<int,P>
#define vpp vector<PP>
#define fi first
#define se second
#define INF 1e9
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    int V,E;
    cin>>V>>E;
    if(E+1<V){
        cout<<"NO"<<endl;
        return 0;
    }else if((V/2)*(V-V/2)<E){
        cout<<"NO"<<endl;
        return 0;
    }
    REP(i,V){
        if(i)cout<<" ";
        if(i%2){
            cout<<99999-i/2;
        }else{
            cout<<100000+i/2;
        }
    }cout<<endl;
    REP(i,V-1){
        cout<<i+1<<" "<<i+2<<endl;
        E--;
    }
    REP(i,V){
        FOR(j,1,V){
            if(!E){
                return 0;
            }
            if(abs(i-j)!=1){
                cout<<i+1<<" "<<j+1<<endl;
                E--;
            }
            j++;
        }
        i++;
    }
    return 0;
}
0