Submission #161403

# Submission time Handle Problem Language Result Execution time Memory
161403 2019-11-02T08:42:15 Z georgerapeanu Party (POI11_imp) C++11
0 / 100
1127 ms 17524 KB
#include <cstdio>

using namespace std;

const int NMAX = 3000;

int n,m;
bool adj[NMAX + 5][NMAX + 5];
bool del[NMAX + 5];

int main(){

    scanf("%d %d",&n,&m);

    for(int i = 1;i <= m;i++){
        int x,y;
        scanf("%d %d",&x,&y);
        adj[x][y] = true;
        adj[y][x] = true;;
    }

    for(int i = 1;i <= n;i++){
        if(del[i] == true){
            continue;
        }
        for(int j = i + 1;j <= n;j++){
            if(adj[i][j] == false){
                del[i] = del[j] = true;
            }
        }
    }

    for(int i = 1,cnt = 0;i <= n,cnt < n / 3;i++){
        if(del[i] == false){
            printf("%d ",i);
            cnt++;
        }
    }

    
    return 0;
}

Compilation message

imp.cpp: In function 'int main()':
imp.cpp:33:29: warning: left operand of comma operator has no effect [-Wunused-value]
     for(int i = 1,cnt = 0;i <= n,cnt < n / 3;i++){
                           ~~^~~~
imp.cpp:13: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:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&x,&y);
         ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1016 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 1916 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 2936 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 69 ms 5056 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 217 ms 10084 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 440 ms 10744 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 613 ms 11556 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 756 ms 17524 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 882 ms 11936 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1127 ms 13576 KB Wypisano numer osoby spoza zakresu [1;n]
2 Halted 0 ms 0 KB -