Submission #4342766


Source Code Expand

#include <bits/stdc++.h>
#include <bitset>
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef vector<vector<int> > vvi;
typedef vector<int> vi;
typedef vector<string> vst;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
 
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);  


    int n,m;
    cin >> n >> m;
    vvi tmp(n,vi(n,0));
    REP(i,m) {
        int x,y;
        cin >> x >> y;
        x--;y--;
        tmp[x][y] = tmp[y][x] = 1;
    }
    REP(i,n)tmp[i][i] = 1;

    int maxi=0;

    REP(i,1<<n){
        vi id;
        REP(j,n) if(i & (1<<j)) id.pb(j);

        bool f=true;
        REP(j,id.size()){
            REP(k,id.size()){
                if(tmp[id[j]][id[k]]==0) f=false;
            }
        }
        if(f)maxi=max(maxi,(int)id.size());
    }

    cout << maxi << endl;
    
    return 0;
}

Submission Info

Submission Time
Task A - 正直者
User kyuki3rain
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1310 Byte
Status RE
Exec Time 2402 ms
Memory 1780 KB

Judge Result

Set Name all
Score / Max Score 0 / 100
Status
TLE × 1
RE × 26
Set Name Test Cases
all 00_sample_01.txt, 00_sample_02.txt, kensho_diff01, kensho_diff02, kensho_diff03, kensho_diff04, kensho_diff05, kensho_min-max01, kensho_min-max02, kensho_min-max03, kensho_min-max04, kensho_min-max05, kensho_min-max06, kensho_min-max07, kensho_min-max08, kensho_min-max09, kensho_min-max10, kensho_rand01, kensho_rand02, kensho_rand03, kensho_rand04, kensho_rand05, kensho_rand06, kensho_rand07, kensho_rand08, kensho_rand09, kensho_rand10
Case Name Status Exec Time Memory
00_sample_01.txt RE 96 ms 256 KB
00_sample_02.txt RE 2083 ms -677760 KB
kensho_diff01 RE 1530 ms -752516 KB
kensho_diff02 TLE 2402 ms -615088 KB
kensho_diff03 RE 1603 ms -615328 KB
kensho_diff04 RE 1694 ms -615332 KB
kensho_diff05 RE 1768 ms -615328 KB
kensho_min-max01 RE 263 ms 1780 KB
kensho_min-max02 RE 97 ms 256 KB
kensho_min-max03 RE 97 ms 256 KB
kensho_min-max04 RE 97 ms 256 KB
kensho_min-max05 RE 97 ms 256 KB
kensho_min-max06 RE 97 ms 256 KB
kensho_min-max07 RE 97 ms 256 KB
kensho_min-max08 RE 97 ms 256 KB
kensho_min-max09 RE 97 ms 256 KB
kensho_min-max10 RE 97 ms 256 KB
kensho_rand01 RE 1397 ms -736000 KB
kensho_rand02 RE 1329 ms -614928 KB
kensho_rand03 RE 1388 ms -842892 KB
kensho_rand04 RE 1310 ms -660480 KB
kensho_rand05 RE 1248 ms -615296 KB
kensho_rand06 RE 1403 ms -742924 KB
kensho_rand07 RE 1301 ms -715904 KB
kensho_rand08 RE 1329 ms -680576 KB
kensho_rand09 RE 1293 ms -714624 KB
kensho_rand10 RE 1323 ms -664320 KB