제출 #1106483

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
11064832024-10-30 12:50:22FubuGoldBitaro’s Party (JOI18_bitaro)C++14
0 / 100
26 ms9296 KiB
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
const int BLOCK_SZ = 300;
int n,m,q;
vector<int> adj[MAXN+1]; // rev_adj
vector<pair<int,int>> mx_dis[MAXN+1];
void precomp() {
for (int u=1;u<=n;u++) {
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq;
// pls dont do this
priority_queue<pair<pair<int,int>,pair<int,int>>,vector<pair<pair<int,int>,pair<int,int>>>,greater<pair<pair<int,int>,pair<int,int>>>> adj_pq;
for (int i=0;i<adj[u].size();i++) {
int v = adj[u][i];
vector<pair<int,int>> &vec = mx_dis[v];
adj_pq.push(make_pair(vec.back(),make_pair(v,vec.size()-1)));
}
while (pq.size() < BLOCK_SZ && adj_pq.size()) {
pair<int,int> cur_mx = adj_pq.top().first,cur_id = adj_pq.top().second;
cur_mx.first++;
pq.push(cur_mx);
adj_pq.pop();
cur_id.second--;
if (cur_id.second < 0) continue;
adj_pq.push(make_pair(mx_dis[cur_id.first][cur_id.second],cur_id));
}
if (pq.size() < BLOCK_SZ) pq.push(make_pair(0,u));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

bitaro.cpp: In function 'void precomp()':
bitaro.cpp:16:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for (int i=0;i<adj[u].size();i++) {
      |                      ~^~~~~~~~~~~~~~
bitaro.cpp: In function 'int query_big(int)':
bitaro.cpp:46:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |         for (int j=0;j<adj[i].size();j++) {
      |                      ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...