제출 #197161

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1971612020-01-19 12:00:27arnold518Political Development (BOI17_politicaldevelopment)C++14
54 / 100
3042 ms25860 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 5e4;
int N, K, ans=1;
set<int> adj[MAXN+10];
bool vis[MAXN+10];
int main()
{
int i, j, k;
scanf("%d%d", &N, &K);
for(i=1; i<=N; i++)
{
int s;
scanf("%d", &s);
while(s--) { int t; scanf("%d", &t); adj[i].insert(t+1); }
}
while(1)
{
pii t(987654321, 0);
for(i=1; i<=N; i++) if(!vis[i]) t=min(t, pii(adj[i].size(), i));
if(t.second==0) break;
int now=t.second;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:38:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(j=0; j<chd.size(); j++) if(i&(1<<j)) V.push_back(chd[j]);
             ~^~~~~~~~~~~
politicaldevelopment.cpp:40:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(j=0; j<V.size(); j++) for(k=j+1; k<V.size(); k++) if(adj[V[j]].find(V[k])==adj[V[j]].end()) flag=false;
             ~^~~~~~~~~
politicaldevelopment.cpp:40:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(j=0; j<V.size(); j++) for(k=j+1; k<V.size(); k++) if(adj[V[j]].find(V[k])==adj[V[j]].end()) flag=false;
                                         ~^~~~~~~~~
politicaldevelopment.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &N, &K);
  ~~~~~^~~~~~~~~~~~~~~~
politicaldevelopment.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &s);
   ~~~~~^~~~~~~~~~
politicaldevelopment.cpp:22:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   while(s--) { int t; scanf("%d", &t); adj[i].insert(t+1); }
                       ~~~~~^~~~~~~~~~
#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...