제출 #220796

#제출 시각아이디문제언어결과실행 시간메모리
220796Haunted_CppGeppetto (COCI15_geppetto)C++17
40 / 80
1094 ms504 KiB
/** * author: Haunted_Cpp **/ /***************** [LIBRARY PROTOCOL] ****************/ #include<bits/stdc++.h> using namespace std; /********************* [CONSTANTS] *******************/ #define INF 1e9 #define F first #define S second #define PB push_back #define MP make_pair typedef long ld; typedef long long lld; typedef pair<int,int>ii; vector<int>dr={+1,-1,+0,+0,+1,-1,-1,+1}; vector<int>dc={+0,+0,+1,-1,+1,-1,+1,-1}; /******************** [FUNCTIONS] ********************/ int N,A=0; set<ii>cantUse; void solve(int S,unordered_set<int>ans){ if(S==N+1){ for(auto itF:ans){ for(auto itS:ans){ if(cantUse.find({itF,itS})!=cantUse.end())return; } } A++; return; } solve(S+1,ans); ans.insert(S); solve(S+1,ans); } /*********************** [MAIN] **********************/ int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int M;cin>>N>>M; for(int i=0;i<M;i++){ int u,v;cin>>u>>v; cantUse.insert({u,v}); } solve(1,unordered_set<int>()); cout<<A<<'\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...