結果

問題 No.479 頂点は要らない
ユーザー 小指が強い人小指が強い人
提出日時 2017-03-14 11:26:22
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,607 bytes
コンパイル時間 1,694 ms
コンパイル使用メモリ 176,780 KB
実行使用メモリ 17,848 KB
最終ジャッジ日時 2023-09-12 12:19:27
合計ジャッジ時間 5,035 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,204 KB
testcase_01 AC 4 ms
8,292 KB
testcase_02 AC 3 ms
8,152 KB
testcase_03 AC 4 ms
8,332 KB
testcase_04 WA -
testcase_05 AC 4 ms
8,444 KB
testcase_06 AC 3 ms
8,276 KB
testcase_07 AC 4 ms
8,144 KB
testcase_08 AC 4 ms
8,144 KB
testcase_09 AC 3 ms
8,128 KB
testcase_10 AC 4 ms
8,144 KB
testcase_11 AC 4 ms
8,136 KB
testcase_12 WA -
testcase_13 AC 4 ms
8,180 KB
testcase_14 AC 4 ms
8,132 KB
testcase_15 AC 4 ms
8,444 KB
testcase_16 AC 3 ms
8,188 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 4 ms
8,228 KB
testcase_22 AC 5 ms
8,364 KB
testcase_23 WA -
testcase_24 AC 4 ms
8,300 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 102 ms
17,508 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<ll> vecll;
typedef vector<string> vecs;
template<class T,class U> using Hash=unordered_map<T,U>;
 
#define REP(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define RREP(i, a, n) for(ll i = n-1; i >= (ll)(a); i--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, 0, n)
#define MD 1000000007
#define _SPLIT " "
 
template<class T> T read(){T a;cin >> a;return a;}
template<class T> void read(T& a){cin >> a;}
template<class T,class ...Args> void read(T& a, Args&... args){cin >> a; read(args...);} 
template<class T> void rarr(T a, int n){for(int i = 0; i < n; i++) {cin >> a[i];}}
template<class T> void write(T a){cout << setprecision(24) << a << endl;}
template<class T,class ...Args> void write(T a, Args... args){cout << setprecision(24) << a << _SPLIT; write(args...);}
template<class T> void warr(vector<T> a, const char* c = " "){cout << a[0];for(int i = 1; i < (int)a.size(); i++)cout << c << a[i];cout << endl;;}
template<class T> void warr(T a, int n, const char* c = " "){cout << a[0];for(int i = 1; i < n; i++)cout << c << a[i];cout << endl;}
template<class T> void warr(T begin, T end, const char* c = " "){cout << *begin;for(auto i = begin+1; i != end; i++)cout << c << *i;cout << endl;}
void split(string s, string delim, veci& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(atoi(s.substr(pos).data()));break;}else {result.push_back(atoi(s.substr(pos, p - pos).data()));}pos = p + delim.size();}}
void split(string s, string delim, vecs& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(s.substr(pos));break;}else {result.push_back(s.substr(pos, p - pos));}pos = p + delim.size();}}
ll gcd(ll a, ll b){while(true){ll k = a % b;if(k == 0)return b;a = b;b = k;}}
ll comb(ll n, ll m){ll p=1;m=min(m,n-m);for(ll i=1;i<=m;i++){p*=n-i+1;p/=i;}return p;}

int main(void)
{
    int n,m;
    bool b[100000]={0};
    set<int> st[100000];
    read(n,m);
    rep(i,m){
        int a,b;
        read(a,b);
        st[a].insert(b);
        st[b].insert(a);
    }
    int mm=0;
    rrep(i,n){
        int vmin=*st[i].begin();
        int vmax=*st[i].rbegin();
        if((i<vmax&&!b[vmax])||i<vmin){
            b[i]=true;
            mm=max(mm,(int)i);
        }
    }
    rrep(i,mm+1){
        cout<<b[i];
    }
    cout<<endl;
    return 0;
}
0