Submission #980818

#TimeUsernameProblemLanguageResultExecution timeMemory
980818UnforgettableplDuathlon (APIO18_duathlon)C++17
0 / 100
1036 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int adj[11][11]; set<tuple<int,int,int>> ans; void calc(const vector<int>& path){ if(path.size()<3)return; for(int i=1;i<path.size();i++){ if(!adj[path[i]][path[i-1]])return; for(int k=1;k<i;k++)ans.insert({path[0],path[k],path[i]}); } } int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n,m; cin >> n >> m; for(int i=1;i<=m;i++){ int a,b;cin>>a>>b; adj[a][b]=adj[b][a]=true; } vector<int> path(n);iota(path.begin(), path.end(),1); do { calc(path); } while(next_permutation(path.begin(), path.end())); cout << ans.size() << '\n'; }

Compilation message (stderr)

count_triplets.cpp: In function 'void calc(const std::vector<long long int>&)':
count_triplets.cpp:11:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=1;i<path.size();i++){
      |                 ~^~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...