제출 #991519

#제출 시각아이디문제언어결과실행 시간메모리
991519Nika5339월 (APIO24_september)C++17
45 / 100
117 ms8872 KiB
#pragma GCC diagnostic warning "-std=c++11" #include <bits/stdc++.h> #define pb push_back #define f first #define s second #define MOD 1000000007 #define flush fflush(stdout) #define all(x) (x).begin(),(x).end() #define allr(x) (x).rbegin(), (x).rend() #define pii pair<int,int> using namespace std; const int N=1e5+5; int T,k,sz[N],p[N]; vector<int> g[N]; void make_set(int v) { p[v]=v; sz[v]=1; } int find_set(int v) { if (p[v]==v) return v; return p[v]=find_set(p[v]); } void merge(int a, int b) { a=find_set(a); b=find_set(b); if (a==b) return; if (sz[a]<sz[b]) swap(a,b); sz[a]+=sz[b]; p[b]=a; } void add_edges(int v) { for (auto u:g[v]) if (p[u]>=0) merge(u,v); } int solve(int n, int m, vector<int> F,vector<vector<int>> S) { for (int i=0; i<n; i++) { p[i]=-1; g[i].clear(); } for (int i=1; i<n; i++) { g[i].pb(F[i]); g[F[i]].pb(i); } int ans=0; make_set(0); for (int i=n-2; i>=0; i--) { int x=S[0][i]; make_set(x); add_edges(x); if (sz[find_set(x)]==n-i) ans++; } return ans; }

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

september.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
    1 | #pragma GCC diagnostic warning "-std=c++11"
      |                                ^~~~~~~~~~~~
#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...
#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...