Submission #1005513

# Submission time Handle Problem Language Result Execution time Memory
1005513 2024-06-22T14:04:53 Z vjudge1 Party (POI11_imp) C++17
100 / 100
350 ms 9300 KB
#include <bits/stdc++.h>
 
using namespace std;
 
#define int long long
 
const int maxn = 3005;
 
bool adj[maxn][maxn];
 
signed main()
{
  cin.tie(0) -> sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
 
  for(int i = 0; i < m; i++){
    int u, v;
    cin >> u >> v;
 
    adj[u][v] = 1;
    adj[v][u] = 1;
  }
 
  bool skip[n + 5] = {};
  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= n; j++){
      if(skip[i] || skip[j] || i == j) continue;
 
      if(!adj[i][j]){
        skip[i] = 1;
        skip[j] = 1;
      }
    }
  }
 
  int t = 0;
  vector<int>ans;
  for(int i = 1; i <= n && t < n / 3; i++){
    if(skip[i]) continue;
 
    t++;
    ans.push_back(i);
  }
 
  for(int i : ans) cout << i << ' ';
}
# Verdict Execution time Memory Grader output
1 Correct 1 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 8 ms 2652 KB Output is correct
3 Correct 8 ms 2648 KB Output is correct
4 Correct 9 ms 2652 KB Output is correct
5 Correct 8 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2652 KB Output is correct
2 Correct 32 ms 4700 KB Output is correct
3 Correct 33 ms 4700 KB Output is correct
4 Correct 31 ms 4700 KB Output is correct
5 Correct 32 ms 4700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2648 KB Output is correct
2 Correct 76 ms 7000 KB Output is correct
3 Correct 74 ms 6744 KB Output is correct
4 Correct 74 ms 6748 KB Output is correct
5 Correct 76 ms 6744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 4700 KB Output is correct
2 Correct 118 ms 6748 KB Output is correct
3 Correct 109 ms 6796 KB Output is correct
4 Correct 111 ms 6744 KB Output is correct
5 Correct 106 ms 6744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 6780 KB Output is correct
2 Correct 146 ms 6744 KB Output is correct
3 Correct 180 ms 6780 KB Output is correct
4 Correct 135 ms 6744 KB Output is correct
5 Correct 161 ms 6776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 125 ms 6780 KB Output is correct
2 Correct 187 ms 8792 KB Output is correct
3 Correct 186 ms 8828 KB Output is correct
4 Correct 180 ms 8852 KB Output is correct
5 Correct 179 ms 8836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 162 ms 8792 KB Output is correct
2 Correct 218 ms 8848 KB Output is correct
3 Correct 212 ms 9044 KB Output is correct
4 Correct 210 ms 8796 KB Output is correct
5 Correct 213 ms 8792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 188 ms 8796 KB Output is correct
2 Correct 232 ms 8836 KB Output is correct
3 Correct 254 ms 8848 KB Output is correct
4 Correct 259 ms 8828 KB Output is correct
5 Correct 260 ms 9048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 229 ms 8792 KB Output is correct
2 Correct 292 ms 8792 KB Output is correct
3 Correct 289 ms 8972 KB Output is correct
4 Correct 318 ms 8796 KB Output is correct
5 Correct 314 ms 8796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 336 ms 9048 KB Output is correct
2 Correct 350 ms 9300 KB Output is correct
3 Correct 346 ms 9048 KB Output is correct
4 Correct 318 ms 9272 KB Output is correct
5 Correct 310 ms 9276 KB Output is correct