Submission #226368

# Submission time Handle Problem Language Result Execution time Memory
226368 2020-04-23T14:32:18 Z DodgeBallMan Party (POI11_imp) C++14
0 / 100
1056 ms 63768 KB
#include <bits/stdc++.h>

using namespace std;

const int N = 3e3 + 10;
int n, m, edge[N][N], inv[N];

int main()
{
    fill( inv, inv + N, 1 );
    scanf("%d %d",&n,&m);
    for( int i = 1, a, b ; i <= m ; i++ ) {
        scanf("%d %d",&a,&b);
        edge[a][b] = edge[b][a] = 1;
    }
    for( int i = 1 ; i <= n ; i++ ) {
        for( int j = i + 1 ; j <= n ; j++ ) {
            if( edge[i][j] && inv[i] && inv[j] ) inv[i] = inv[j] = 0;
        }
    }
    int cnt = 0;
    for( int i = 1 ; i <= n && cnt < n / 3 ; i++ ) {
        if( inv[i] ) {
            printf("%d ",i);
            cnt++;
        }
    }
    return 0;
}

Compilation message

imp.cpp: In function 'int main()':
imp.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~
imp.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&a,&b);
         ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 512 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 1536 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 2944 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 4992 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 9208 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 249 ms 21752 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 474 ms 36220 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 624 ms 43640 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 739 ms 48904 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 850 ms 54744 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1056 ms 63768 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -