Submission #980818

# Submission time Handle Problem Language Result Execution time Memory
980818 2024-05-12T13:11:42 Z Unforgettablepl Duathlon (APIO18_duathlon) C++17
0 / 100
1000 ms 604 KB
#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

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 time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 22 ms 348 KB Output is correct
7 Correct 27 ms 348 KB Output is correct
8 Correct 69 ms 468 KB Output is correct
9 Correct 314 ms 476 KB Output is correct
10 Execution timed out 1036 ms 592 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 22 ms 348 KB Output is correct
7 Correct 27 ms 348 KB Output is correct
8 Correct 69 ms 468 KB Output is correct
9 Correct 314 ms 476 KB Output is correct
10 Execution timed out 1036 ms 592 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 22 ms 348 KB Output is correct
7 Correct 27 ms 348 KB Output is correct
8 Correct 69 ms 468 KB Output is correct
9 Correct 314 ms 476 KB Output is correct
10 Execution timed out 1036 ms 592 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 22 ms 348 KB Output is correct
7 Correct 27 ms 348 KB Output is correct
8 Correct 69 ms 468 KB Output is correct
9 Correct 314 ms 476 KB Output is correct
10 Execution timed out 1036 ms 592 KB Time limit exceeded
11 Halted 0 ms 0 KB -