Submission #4342644


Source Code Expand

#include <bits/stdc++.h>
#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};


struct k{
    int s,e;
};

bool asc( const k& left, const k& right ) {
    return left.s == right.s ? left.e < right.e : left.s < right.s;
}



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

    int maxi=0;

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

        bool f=true;
        REP(j,a.size()){
            REP(k,a.size()){
                if(tmp[a[j]][a[k]]==0) f=false;
            }
        }
        if(f)maxi=(maxi<(int)a.size())?(int)a.size():maxi;
    }

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

Submission Info

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

Judge Result

Set Name all
Score / Max Score 0 / 100
Status
WA × 6
TLE × 2
RE × 19
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 98 ms 256 KB
00_sample_02.txt TLE 2399 ms -627532 KB
kensho_diff01 RE 1871 ms -750860 KB
kensho_diff02 TLE 2538 ms -624604 KB
kensho_diff03 RE 1706 ms -624652 KB
kensho_diff04 RE 1715 ms -624284 KB
kensho_diff05 RE 1569 ms -624324 KB
kensho_min-max01 WA 661 ms 1780 KB
kensho_min-max02 WA 658 ms 256 KB
kensho_min-max03 RE 247 ms 384 KB
kensho_min-max04 RE 99 ms 256 KB
kensho_min-max05 WA 649 ms 256 KB
kensho_min-max06 RE 96 ms 256 KB
kensho_min-max07 WA 649 ms 256 KB
kensho_min-max08 WA 649 ms 256 KB
kensho_min-max09 WA 649 ms 256 KB
kensho_min-max10 RE 97 ms 256 KB
kensho_rand01 RE 1410 ms -651520 KB
kensho_rand02 RE 1349 ms -673420 KB
kensho_rand03 RE 1362 ms -625696 KB
kensho_rand04 RE 1386 ms -823948 KB
kensho_rand05 RE 1376 ms -666624 KB
kensho_rand06 RE 1324 ms -676480 KB
kensho_rand07 RE 1302 ms -692224 KB
kensho_rand08 RE 1257 ms -755456 KB
kensho_rand09 RE 1324 ms -685824 KB
kensho_rand10 RE 1231 ms -769536 KB