제출 #269548

#제출 시각아이디문제언어결과실행 시간메모리
269548mayhoubsalehGeppetto (COCI15_geppetto)C++14
80 / 80
6 ms2688 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define left 2*i+1 #define righ 2*i+2 #define mid (l+r)/2 #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; const int maxn=1e5+100; const int inf=1e9+10; const int mod=1e4+7; int n,m; vector<int>v[maxn]; int pro[maxn]; int solve(int id){ if(id==n)return 1; if(pro[id])return solve(id+1); int ret=solve(id+1); for(auto x:v[id]){ pro[x]++; } ret+=solve(id+1); for(auto x:v[id])pro[x]--; return ret; } int main() { IOS cin>>n>>m; for(int i=0;i<m;i++){ int x,y; cin>>x>>y; x--;y--; v[x].pb(y); v[y].pb(x); } cout<<solve(0)<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...