Submission #1005510

# Submission time Handle Problem Language Result Execution time Memory
1005510 2024-06-22T14:02:37 Z basa Party (POI11_imp) C++14
9 / 100
292 ms 9304 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 0 ms 344 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 Incorrect 8 ms 2696 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2652 KB Output is correct
2 Incorrect 30 ms 4700 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2648 KB Output is correct
2 Incorrect 75 ms 6744 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 22 ms 4700 KB Output is correct
2 Incorrect 105 ms 6748 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 75 ms 6796 KB Output is correct
2 Incorrect 136 ms 6748 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 132 ms 6792 KB Output is correct
2 Incorrect 167 ms 8792 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 178 ms 8832 KB Output is correct
2 Incorrect 220 ms 9048 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 179 ms 8792 KB Output is correct
2 Incorrect 243 ms 8832 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 223 ms 8796 KB Output is correct
2 Incorrect 290 ms 8792 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 251 ms 9052 KB Output is correct
2 Incorrect 292 ms 9304 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -