답안 #203119

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
203119 2020-02-19T12:32:42 Z MKopchev Party (POI11_imp) C++14
100 / 100
1430 ms 41328 KB
#include<bits/stdc++.h>
using namespace std;
const int nmax=3e3+42;
bool edge[nmax][nmax];
int n,m;

bool in[nmax];
int main()
{
    scanf("%i%i",&n,&m);
    int u,v;
    for(int i=1;i<=m;i++)
    {
        scanf("%i%i",&u,&v);
        edge[u][v]=1;
        edge[v][u]=1;
    }

    for(int i=1;i<=n;i++)in[i]=1;

    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
            if(edge[i][j]==0&&in[i]&&in[j])
            {
                in[i]=0;
                in[j]=0;
            }

    int out=n/3;
    for(int i=1;i<=n;i++)
        if(in[i])
        {
            printf("%i ",i);
            out--;
            if(out==0)break;
        }
    printf("\n");
    return 0;
}

Compilation message

imp.cpp: In function 'int main()':
imp.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%i%i",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
imp.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%i%i",&u,&v);
         ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 504 KB Output is correct
3 Correct 6 ms 632 KB Output is correct
4 Correct 6 ms 632 KB Output is correct
5 Correct 6 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 1016 KB Output is correct
2 Correct 28 ms 2476 KB Output is correct
3 Correct 28 ms 2552 KB Output is correct
4 Correct 28 ms 2552 KB Output is correct
5 Correct 27 ms 2556 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 2040 KB Output is correct
2 Correct 111 ms 6408 KB Output is correct
3 Correct 104 ms 6396 KB Output is correct
4 Correct 104 ms 6264 KB Output is correct
5 Correct 104 ms 6264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 3064 KB Output is correct
2 Correct 262 ms 12152 KB Output is correct
3 Correct 249 ms 12024 KB Output is correct
4 Correct 245 ms 12024 KB Output is correct
5 Correct 248 ms 12152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 74 ms 5116 KB Output is correct
2 Correct 374 ms 16632 KB Output is correct
3 Correct 408 ms 16376 KB Output is correct
4 Correct 373 ms 16504 KB Output is correct
5 Correct 362 ms 16504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 228 ms 11368 KB Output is correct
2 Correct 489 ms 19976 KB Output is correct
3 Correct 486 ms 19704 KB Output is correct
4 Correct 482 ms 19848 KB Output is correct
5 Correct 481 ms 20088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 440 ms 18552 KB Output is correct
2 Correct 672 ms 25720 KB Output is correct
3 Correct 657 ms 25464 KB Output is correct
4 Correct 690 ms 25464 KB Output is correct
5 Correct 689 ms 25464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 620 ms 23160 KB Output is correct
2 Correct 826 ms 29688 KB Output is correct
3 Correct 807 ms 29432 KB Output is correct
4 Correct 836 ms 29428 KB Output is correct
5 Correct 834 ms 29688 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 755 ms 27120 KB Output is correct
2 Correct 1010 ms 34164 KB Output is correct
3 Correct 995 ms 33652 KB Output is correct
4 Correct 1008 ms 33752 KB Output is correct
5 Correct 1008 ms 34200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 886 ms 30956 KB Output is correct
2 Correct 1201 ms 39032 KB Output is correct
3 Correct 1170 ms 38160 KB Output is correct
4 Correct 1208 ms 38488 KB Output is correct
5 Correct 1330 ms 38392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1242 ms 37308 KB Output is correct
2 Correct 1430 ms 41328 KB Output is correct
3 Correct 1346 ms 40792 KB Output is correct
4 Correct 1354 ms 41012 KB Output is correct
5 Correct 1274 ms 41140 KB Output is correct