제출 #821366

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8213662023-08-11 09:34:33radaiosm7Game (APIO22_game)C++17
30 / 100
82 ms444 KiB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[1005];
int visited[1005];
int ind[1005];
int i, n, k, s;
int seg[4020];
int Query(int from, int to, int start=0, int ende=1005, int indx=1) {
if (from == start && to == ende) return seg[indx];
int mid = (start+ende)/2;
if (to <= mid) return Query(from, to, start, mid, 2*indx);
if (from > mid) return Query(from, to, mid+1, ende, 2*indx+1);
else return min(Query(from, mid, start, mid, 2*indx), Query(mid+1, to, mid+1, ende, 2*indx+1));
}
void Insert(int val, int start=0, int ende=1005, int indx=1) {
if (start == ende) {
seg[indx] = val;
ind[val] = s;
++s;
return;
}
int mid = (start+ende)/2;
if (s <= mid) Insert(val, start, mid, 2*indx);
else Insert(val, mid+1, ende, 2*indx+1);
seg[indx] = min(seg[2*indx], seg[2*indx+1]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...