# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
269548 | mayhoubsaleh | Geppetto (COCI15_geppetto) | C++14 | 6 ms | 2688 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |