Submission #1005483

# Submission time Handle Problem Language Result Execution time Memory
1005483 2024-06-22T13:43:40 Z Almonther Party (POI11_imp) C++
100 / 100
362 ms 40868 KB
#include <bits/stdc++.h>

#define suiii ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define co cout<<
//#pragma GCC optimize("O3,Ofast,unroll-loops")
//#pragma GCC target("avx2,sse3,sse4,avx")
using namespace std;
//stuff
ll n,m;
bool del[3005];
bool mat[3005][3005];
void solve(){
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        ll a,b;
        cin>>a>>b;
        mat[a][b]=1;
        mat[b][a]=1;
    }
    for(int i=1;i<=n;i++){
        if(del[i]) continue;
        for(int j=i+1;j<=n;j++){
            if(del[j]) continue;
            if(mat[i][j]==0){
                del[i]=1;
                del[j]=1;
                break;
            }
        }
    }
    ll num=0;
    for(int i=1;i<=n;i++){
        if(del[i]==0&&num<n/3){
            co i<<' ';
            num++;
        }
    }
}
int main()
{
    suiii
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2652 KB Output is correct
2 Correct 7 ms 2652 KB Output is correct
3 Correct 8 ms 3324 KB Output is correct
4 Correct 8 ms 3192 KB Output is correct
5 Correct 8 ms 3412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2652 KB Output is correct
2 Correct 29 ms 4700 KB Output is correct
3 Correct 29 ms 4696 KB Output is correct
4 Correct 30 ms 4696 KB Output is correct
5 Correct 31 ms 4696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 2904 KB Output is correct
2 Correct 75 ms 6748 KB Output is correct
3 Correct 73 ms 6744 KB Output is correct
4 Correct 71 ms 6780 KB Output is correct
5 Correct 72 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 4700 KB Output is correct
2 Correct 107 ms 6744 KB Output is correct
3 Correct 106 ms 6748 KB Output is correct
4 Correct 106 ms 6744 KB Output is correct
5 Correct 116 ms 17488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 65 ms 6744 KB Output is correct
2 Correct 147 ms 6744 KB Output is correct
3 Correct 129 ms 6744 KB Output is correct
4 Correct 180 ms 20048 KB Output is correct
5 Correct 136 ms 20048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 6780 KB Output is correct
2 Correct 176 ms 8796 KB Output is correct
3 Correct 176 ms 9048 KB Output is correct
4 Correct 182 ms 8796 KB Output is correct
5 Correct 177 ms 26752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 150 ms 9040 KB Output is correct
2 Correct 213 ms 8792 KB Output is correct
3 Correct 206 ms 8796 KB Output is correct
4 Correct 219 ms 8796 KB Output is correct
5 Correct 246 ms 8796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 185 ms 8796 KB Output is correct
2 Correct 277 ms 8836 KB Output is correct
3 Correct 266 ms 33908 KB Output is correct
4 Correct 318 ms 34164 KB Output is correct
5 Correct 277 ms 34128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 223 ms 8792 KB Output is correct
2 Correct 360 ms 8796 KB Output is correct
3 Correct 362 ms 37968 KB Output is correct
4 Correct 334 ms 38268 KB Output is correct
5 Correct 294 ms 38116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 278 ms 9052 KB Output is correct
2 Correct 273 ms 9052 KB Output is correct
3 Correct 303 ms 9048 KB Output is correct
4 Correct 330 ms 40864 KB Output is correct
5 Correct 351 ms 40868 KB Output is correct