답안 #59309

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
59309 2018-07-21T13:11:53 Z MatheusLealV 철인 이종 경기 (APIO18_duathlon) C++17
5 / 100
551 ms 13784 KB
#include <bits/stdc++.h>
#define N 100050
using namespace std;
typedef long long ll;
ll n, m, c, ans, ok[N];
   
vector<ll> grafo[N];
 
ll ini, mid, fim, oki = 0, dp[15][2000];
 
void dfs(ll x, ll mask)
{
    if(dp[x][mask]) return;
 
    dp[x][mask] = 1;
 
    if(x == fim)
    {
        if( (mask & (1<<mid)) && (mask & (1<<ini))) oki = 1;
 
        return;
    }
 
    for(auto v: grafo[x])
    {
        if(mask & (1<<v)) continue;
 
        dfs(v, mask | (1<<v));
    }
}
  
ll sz[100050], root;
  
ll B, C;
  
int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
  
    cin>>n>>m;    
  
    for(ll i = 1, a, b; i <= m; i++)
    {
        cin>>a>>b;
 
        a --, b--;
  
        grafo[a].push_back(b);
  
        grafo[b].push_back(a);
    }
   
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            for(int z = 0; z < n; z++)
            {
                ini = i, mid = j, fim = z;
 
                if(i == j || i == z || j == z) continue;
 
                oki = 0;
 
                memset(dp, 0, sizeof dp);
 
                dfs(i, 1<<i);
 
                if(oki) ans ++;
            }
        }
    }
 
    cout<<ans<<"\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 2936 KB Output is correct
2 Correct 7 ms 2936 KB Output is correct
3 Correct 6 ms 3084 KB Output is correct
4 Correct 5 ms 3084 KB Output is correct
5 Correct 5 ms 3088 KB Output is correct
6 Correct 13 ms 3220 KB Output is correct
7 Correct 15 ms 3220 KB Output is correct
8 Correct 16 ms 3220 KB Output is correct
9 Correct 42 ms 3252 KB Output is correct
10 Correct 69 ms 3316 KB Output is correct
11 Correct 16 ms 3384 KB Output is correct
12 Correct 14 ms 3388 KB Output is correct
13 Correct 14 ms 3392 KB Output is correct
14 Correct 13 ms 3400 KB Output is correct
15 Correct 13 ms 3420 KB Output is correct
16 Correct 16 ms 3424 KB Output is correct
17 Correct 16 ms 3424 KB Output is correct
18 Correct 15 ms 3432 KB Output is correct
19 Correct 14 ms 3436 KB Output is correct
20 Correct 14 ms 3524 KB Output is correct
21 Correct 14 ms 3524 KB Output is correct
22 Correct 15 ms 3524 KB Output is correct
23 Correct 14 ms 3564 KB Output is correct
24 Correct 11 ms 3564 KB Output is correct
25 Correct 14 ms 3564 KB Output is correct
26 Correct 14 ms 3564 KB Output is correct
27 Correct 10 ms 3564 KB Output is correct
28 Correct 12 ms 3564 KB Output is correct
29 Correct 17 ms 3564 KB Output is correct
30 Correct 11 ms 3564 KB Output is correct
31 Correct 14 ms 3564 KB Output is correct
32 Correct 17 ms 3564 KB Output is correct
33 Correct 12 ms 3564 KB Output is correct
34 Correct 13 ms 3564 KB Output is correct
35 Correct 14 ms 3580 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 2936 KB Output is correct
2 Correct 7 ms 2936 KB Output is correct
3 Correct 6 ms 3084 KB Output is correct
4 Correct 5 ms 3084 KB Output is correct
5 Correct 5 ms 3088 KB Output is correct
6 Correct 13 ms 3220 KB Output is correct
7 Correct 15 ms 3220 KB Output is correct
8 Correct 16 ms 3220 KB Output is correct
9 Correct 42 ms 3252 KB Output is correct
10 Correct 69 ms 3316 KB Output is correct
11 Correct 16 ms 3384 KB Output is correct
12 Correct 14 ms 3388 KB Output is correct
13 Correct 14 ms 3392 KB Output is correct
14 Correct 13 ms 3400 KB Output is correct
15 Correct 13 ms 3420 KB Output is correct
16 Correct 16 ms 3424 KB Output is correct
17 Correct 16 ms 3424 KB Output is correct
18 Correct 15 ms 3432 KB Output is correct
19 Correct 14 ms 3436 KB Output is correct
20 Correct 14 ms 3524 KB Output is correct
21 Correct 14 ms 3524 KB Output is correct
22 Correct 15 ms 3524 KB Output is correct
23 Correct 14 ms 3564 KB Output is correct
24 Correct 11 ms 3564 KB Output is correct
25 Correct 14 ms 3564 KB Output is correct
26 Correct 14 ms 3564 KB Output is correct
27 Correct 10 ms 3564 KB Output is correct
28 Correct 12 ms 3564 KB Output is correct
29 Correct 17 ms 3564 KB Output is correct
30 Correct 11 ms 3564 KB Output is correct
31 Correct 14 ms 3564 KB Output is correct
32 Correct 17 ms 3564 KB Output is correct
33 Correct 12 ms 3564 KB Output is correct
34 Correct 13 ms 3564 KB Output is correct
35 Correct 14 ms 3580 KB Output is correct
36 Runtime error 551 ms 6224 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 56 ms 12532 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 9 ms 12532 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 61 ms 13712 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 11 ms 13712 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 103 ms 13784 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 2936 KB Output is correct
2 Correct 7 ms 2936 KB Output is correct
3 Correct 6 ms 3084 KB Output is correct
4 Correct 5 ms 3084 KB Output is correct
5 Correct 5 ms 3088 KB Output is correct
6 Correct 13 ms 3220 KB Output is correct
7 Correct 15 ms 3220 KB Output is correct
8 Correct 16 ms 3220 KB Output is correct
9 Correct 42 ms 3252 KB Output is correct
10 Correct 69 ms 3316 KB Output is correct
11 Correct 16 ms 3384 KB Output is correct
12 Correct 14 ms 3388 KB Output is correct
13 Correct 14 ms 3392 KB Output is correct
14 Correct 13 ms 3400 KB Output is correct
15 Correct 13 ms 3420 KB Output is correct
16 Correct 16 ms 3424 KB Output is correct
17 Correct 16 ms 3424 KB Output is correct
18 Correct 15 ms 3432 KB Output is correct
19 Correct 14 ms 3436 KB Output is correct
20 Correct 14 ms 3524 KB Output is correct
21 Correct 14 ms 3524 KB Output is correct
22 Correct 15 ms 3524 KB Output is correct
23 Correct 14 ms 3564 KB Output is correct
24 Correct 11 ms 3564 KB Output is correct
25 Correct 14 ms 3564 KB Output is correct
26 Correct 14 ms 3564 KB Output is correct
27 Correct 10 ms 3564 KB Output is correct
28 Correct 12 ms 3564 KB Output is correct
29 Correct 17 ms 3564 KB Output is correct
30 Correct 11 ms 3564 KB Output is correct
31 Correct 14 ms 3564 KB Output is correct
32 Correct 17 ms 3564 KB Output is correct
33 Correct 12 ms 3564 KB Output is correct
34 Correct 13 ms 3564 KB Output is correct
35 Correct 14 ms 3580 KB Output is correct
36 Runtime error 551 ms 6224 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 2936 KB Output is correct
2 Correct 7 ms 2936 KB Output is correct
3 Correct 6 ms 3084 KB Output is correct
4 Correct 5 ms 3084 KB Output is correct
5 Correct 5 ms 3088 KB Output is correct
6 Correct 13 ms 3220 KB Output is correct
7 Correct 15 ms 3220 KB Output is correct
8 Correct 16 ms 3220 KB Output is correct
9 Correct 42 ms 3252 KB Output is correct
10 Correct 69 ms 3316 KB Output is correct
11 Correct 16 ms 3384 KB Output is correct
12 Correct 14 ms 3388 KB Output is correct
13 Correct 14 ms 3392 KB Output is correct
14 Correct 13 ms 3400 KB Output is correct
15 Correct 13 ms 3420 KB Output is correct
16 Correct 16 ms 3424 KB Output is correct
17 Correct 16 ms 3424 KB Output is correct
18 Correct 15 ms 3432 KB Output is correct
19 Correct 14 ms 3436 KB Output is correct
20 Correct 14 ms 3524 KB Output is correct
21 Correct 14 ms 3524 KB Output is correct
22 Correct 15 ms 3524 KB Output is correct
23 Correct 14 ms 3564 KB Output is correct
24 Correct 11 ms 3564 KB Output is correct
25 Correct 14 ms 3564 KB Output is correct
26 Correct 14 ms 3564 KB Output is correct
27 Correct 10 ms 3564 KB Output is correct
28 Correct 12 ms 3564 KB Output is correct
29 Correct 17 ms 3564 KB Output is correct
30 Correct 11 ms 3564 KB Output is correct
31 Correct 14 ms 3564 KB Output is correct
32 Correct 17 ms 3564 KB Output is correct
33 Correct 12 ms 3564 KB Output is correct
34 Correct 13 ms 3564 KB Output is correct
35 Correct 14 ms 3580 KB Output is correct
36 Runtime error 551 ms 6224 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Halted 0 ms 0 KB -