Submission #799212

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7992122023-07-31 10:48:39MadokaMagicaFanPrisoner Challenge (IOI22_prison)C++17
100 / 100
13 ms1004 KiB
#include "bits/stdc++.h"
#include "prison.h"
using namespace std;
using ll = long long;
#define sz(v) ((int)v.size())
#define pb push_back
vector<array<int, 6>> nd;
int dfs(int x) {
int s = nd[x][1] - nd[x][0] + 1;
nd[x][5] = 0;
if (s <= 2) return 0;
s -= 2;
int e = s / 3;
int e1, e2, e3;
if (!e) {
nd[x][2] = sz(nd);
nd.pb({nd[x][0]+1, nd[x][1] - 1, 0, 0, 0});
nd[x][5] = 1;
return 1;
}
if (s < 5) {
nd[x][2] = sz(nd);
nd[x][3] = sz(nd)+1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prison.cpp: In function 'int query(int, int)':
prison.cpp:136:5: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
  136 |  if (cb == 7)
      |     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...