Submission #1061907

# Submission time Handle Problem Language Result Execution time Memory
1061907 2024-08-16T15:06:25 Z MilosMilutinovic A Light Inconvenience (CEOI23_light) C++17
0 / 100
396 ms 608 KB
#include "light.h"
#include <bits/stdc++.h>

using namespace std;

long long n;

void prepare() {
	n = 1;
}

pair<long long, vector<long long>> join(long long p) {
	n += p;
  vector<long long> ids;
  for (int b = 0; b < 60; b++) {
    long long f = (1LL << b);
    if (n - f + 1 > 0) {
      ids.push_back(n - f + 1);
    }
  }
  for (int b = 0; b < 60; b++) {
    long long f = (1LL << b);
    if (f <= n) {
      ids.push_back(f);
    }
  }
  sort(ids.begin(), ids.end());
  ids.erase(unique(ids.begin(), ids.end()), ids.end());
	return {p, ids};
}

pair<long long, vector<long long>> leave(long long p) {
	n -= p;
  vector<long long> ids;
  for (int b = 0; b < 60; b++) {
    long long f = (1LL << b);
    if (n - f + 1 > 0) {
      ids.push_back(n - f + 1);
    }
  }
  for (int b = 0; b < 60; b++) {
    long long f = (1LL << b);
    if (f <= n) {
      ids.push_back(f);
    }
  }
  sort(ids.begin(), ids.end());
  ids.erase(unique(ids.begin(), ids.end()), ids.end());
  return {p, ids};
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 325 ms 428 KB Correct
3 Correct 337 ms 608 KB Correct
4 Incorrect 396 ms 424 KB Not correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Incorrect 1 ms 344 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 342 ms 424 KB Correct
3 Correct 394 ms 424 KB Correct
4 Incorrect 345 ms 424 KB Not correct
5 Halted 0 ms 0 KB -