제출 #1075619

#제출 시각아이디문제언어결과실행 시간메모리
1075619edogawa_somethingSimurgh (IOI17_simurgh)C++17
13 / 100
14 ms604 KiB
#include "simurgh.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vii; typedef pair<ll,ll> pii; #define F first #define S second #define all(v) v.begin(),v.end() #define pb push_back struct dsu { ll pa[50]; void init(ll x) { for(int i=0;i<=x;i++) pa[i]=i; } ll get(ll x) { if(x==pa[x]) return x; return pa[x]=get(pa[x]); } bool unite(ll x,ll y) { x=get(x),y=get(y); if(x==y) return 0; pa[x]=y; return 1; } }d; std::vector<int> find_roads(int n, std::vector<int> u, std::vector<int> vv) { for(int i=0;i<(1<<(u.size()));i++) { if(__builtin_popcount(i)==n-1) { vector<int>v; d.init(n); bool chk=1; for(int bit=0;bit<u.size();bit++) { if(((1<<bit)&i)) { chk&=d.unite(u[bit],vv[bit]); v.pb(bit); } } if(chk) { ll x=count_common_roads(v); if(x==n-1) { return v; } } } } return {}; }

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

simurgh.cpp: In function 'std::vector<int> find_roads(int, std::vector<int>, std::vector<int>)':
simurgh.cpp:36:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |       for(int bit=0;bit<u.size();bit++) {
      |                     ~~~^~~~~~~~~
#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...