Submission #161405

# Submission time Handle Problem Language Result Execution time Memory
161405 2019-11-02T08:44:32 Z georgerapeanu Party (POI11_imp) C++11
9 / 100
1283 ms 9296 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(del[j] == true){
                continue;
            }
            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: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 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 504 KB Output is correct
3 Correct 3 ms 504 KB Output is correct
4 Correct 3 ms 504 KB Output is correct
5 Correct 3 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 1016 KB Output is correct
2 Incorrect 23 ms 1784 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 15 ms 1532 KB Output is correct
2 Incorrect 94 ms 3192 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 2040 KB Output is correct
2 Incorrect 247 ms 4728 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 2936 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 215 ms 4856 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 465 ms 6268 KB Output is correct
2 Incorrect 697 ms 7164 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 617 ms 7032 KB Output is correct
2 Incorrect 839 ms 7672 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 723 ms 7672 KB Wypisano za ma³o osób
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 842 ms 8312 KB Output is correct
2 Incorrect 1283 ms 8824 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1078 ms 9296 KB Output is correct
2 Incorrect 1249 ms 9080 KB Wypisano za ma³o osób
3 Halted 0 ms 0 KB -