제출 #786707

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7867072023-07-18 11:32:08PoonYaPatWorst Reporter 4 (JOI21_worst_reporter4)C++14
100 / 100
655 ms237660 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
int n,p[200005],h[200005];
ll val[200005],Ans;
vector<int> adj[200005],adj2[400005],v[400005];
set<ll> ss[400005];
map<ll,ll> temp[400005];
bool mark[200005],vis[200005];
stack<int> st;
void dfs1(int x) {
vis[x]=true;
st.push(x);
for (auto s : adj[x]) if (!vis[s]) dfs1(s);
}
void dfs2(int x) {
for (auto s : adj2[x]) dfs2(s);
if (adj2[x].size()) {
swap(ss[x],ss[adj2[x][0]]);
swap(temp[x],temp[adj2[x][0]]);
for (int i=1; i<adj2[x].size(); ++i) {
int c=adj2[x][i];
if (ss[c].size()>ss[x].size()) swap(temp[x],temp[c]), swap(ss[x],ss[c]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

worst_reporter2.cpp: In function 'void dfs2(int)':
worst_reporter2.cpp:27:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for (int i=1; i<adj2[x].size(); ++i) {
      |                       ~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...