Submission #1758152


Source Code Expand

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

int G[30][30];

int main() {

    int V,E,K; cin >> V >> E >> K;

    REP(i,E) {
        int a,b; cin >> a >> b;
        G[a][b] = 1;
        G[b][a] = 1;
    }

    REP(i, (1 << V)) {
        vector < int > ans;
        REP(j, V) if ((i >> j) & 1) {
            ans.push_back(j);
        }
        if (ans.size() != K) continue;
        REP(j,ans.size()) {
            REP(k,ans.size()) {
                if (G[ans[j]][ans[k]]) goto nxt;
            }
        }
        REP(j,ans.size()) cout << ans[j] << endl;
        return 0;
        nxt:;
    }

    return 0;
}

Submission Info

Submission Time
Task B - B 問題
User kosakkun
Language C++14 (GCC 5.4.1)
Score 12
Code Size 1249 Byte
Status RE
Exec Time 138 ms
Memory 256 KB

Judge Result

Set Name All asi1024 atetubou climpet DEGwer evima flowlight hogloid ichyo math miki_im natsugiri piroz95 semiexp sigma425 sky58 snuke tozangezan wo01 yosupo zerokugi
Score / Max Score 10 / 10 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 2 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2 0 / 2
Status
AC × 33
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
AC × 1
WA × 1
RE × 1
RE × 1
RE × 1
RE × 1
RE × 1
Set Name Test Cases
All 00_sample_1.txt, 00_sample_2.txt, 00_sample_3.txt, 20_random_1.txt, 20_random_10.txt, 20_random_11.txt, 20_random_12.txt, 20_random_13.txt, 20_random_14.txt, 20_random_15.txt, 20_random_16.txt, 20_random_17.txt, 20_random_18.txt, 20_random_19.txt, 20_random_2.txt, 20_random_20.txt, 20_random_21.txt, 20_random_22.txt, 20_random_23.txt, 20_random_24.txt, 20_random_25.txt, 20_random_26.txt, 20_random_27.txt, 20_random_28.txt, 20_random_29.txt, 20_random_3.txt, 20_random_30.txt, 20_random_4.txt, 20_random_5.txt, 20_random_6.txt, 20_random_7.txt, 20_random_8.txt, 20_random_9.txt
asi1024 31_asi1024.txt
atetubou 32_atetubou.txt
climpet 33_climpet.txt
DEGwer 34_DEGwer.txt
evima 35_evima.txt
flowlight 36_flowlight.txt
hogloid 37_hogloid.txt
ichyo 38_ichyo.txt
math 39_math.txt
miki_im 40_miki_im.txt
natsugiri 41_natsugiri.txt
piroz95 42_piroz95.txt
semiexp 43_semiexp.txt
sigma425 44_sigma425.txt
sky58 45_sky58.txt
snuke 46_snuke.txt
tozangezan 47_tozangezan.txt
wo01 48_wo01.txt
yosupo 49_yosupo.txt
zerokugi 50_zerokugi.txt
Case Name Status Exec Time Memory
00_sample_1.txt AC 1 ms 256 KB
00_sample_2.txt AC 1 ms 256 KB
00_sample_3.txt AC 1 ms 256 KB
20_random_1.txt AC 1 ms 256 KB
20_random_10.txt AC 1 ms 256 KB
20_random_11.txt AC 1 ms 256 KB
20_random_12.txt AC 1 ms 256 KB
20_random_13.txt AC 1 ms 256 KB
20_random_14.txt AC 1 ms 256 KB
20_random_15.txt AC 2 ms 256 KB
20_random_16.txt AC 1 ms 256 KB
20_random_17.txt AC 1 ms 256 KB
20_random_18.txt AC 1 ms 256 KB
20_random_19.txt AC 1 ms 256 KB
20_random_2.txt AC 1 ms 256 KB
20_random_20.txt AC 2 ms 256 KB
20_random_21.txt AC 4 ms 256 KB
20_random_22.txt AC 1 ms 256 KB
20_random_23.txt AC 138 ms 256 KB
20_random_24.txt AC 1 ms 256 KB
20_random_25.txt AC 2 ms 256 KB
20_random_26.txt AC 1 ms 256 KB
20_random_27.txt AC 5 ms 256 KB
20_random_28.txt AC 1 ms 256 KB
20_random_29.txt AC 17 ms 256 KB
20_random_3.txt AC 1 ms 256 KB
20_random_30.txt AC 1 ms 256 KB
20_random_4.txt AC 1 ms 256 KB
20_random_5.txt AC 1 ms 256 KB
20_random_6.txt AC 2 ms 256 KB
20_random_7.txt AC 9 ms 256 KB
20_random_8.txt AC 9 ms 256 KB
20_random_9.txt AC 1 ms 256 KB
31_asi1024.txt RE 104 ms 256 KB
32_atetubou.txt RE 104 ms 256 KB
33_climpet.txt RE 105 ms 256 KB
34_DEGwer.txt RE 105 ms 256 KB
35_evima.txt RE 104 ms 256 KB
36_flowlight.txt RE 102 ms 256 KB
37_hogloid.txt RE 101 ms 256 KB
38_ichyo.txt RE 101 ms 256 KB
39_math.txt RE 102 ms 256 KB
40_miki_im.txt RE 103 ms 256 KB
41_natsugiri.txt RE 102 ms 256 KB
42_piroz95.txt RE 101 ms 256 KB
43_semiexp.txt RE 102 ms 256 KB
44_sigma425.txt AC 1 ms 256 KB
45_sky58.txt WA 1 ms 256 KB
46_snuke.txt RE 102 ms 256 KB
47_tozangezan.txt RE 102 ms 256 KB
48_wo01.txt RE 102 ms 256 KB
49_yosupo.txt RE 105 ms 256 KB
50_zerokugi.txt RE 105 ms 256 KB