답안 #982225

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
982225 2024-05-14T03:45:51 Z Jawad_Akbar_JJ 철인 이종 경기 (APIO18_duathlon) C++17
0 / 100
1000 ms 11860 KB
#include <iostream>
#include <vector>

using namespace std;
const int N = 1e5 + 10;
vector<int> nei[N];
bool seen[55][55][55];

void dfs(int u,vector<int> v){
	v.push_back(u);

	for (int i : v)
		seen[v[0]][u][i] = 1;

	for (int i : nei[u]){
		bool ns = 1;
		for (int j : v)
			if (j == i)
				ns = false;
		if (ns)
			dfs(i,v);
	}
}

signed main(){
	int n,m;
	cin>>n>>m;

	for (int i=1;i<=m;i++){
		int a,b;
		cin>>a>>b;
		nei[a].push_back(b);
		nei[b].push_back(a);
	}

	for (int i=1;i<=n;i++)
		dfs(i,{});

	int ans = 0;

	for (int s = 1;s <= n; s++)
		for (int c = 1;c <= n; c++)
			for (int f = 1;f <= n; f++)
				if ( !(s == c or s == f or c == f) )
					ans += seen[s][f][c];
	cout<<ans<<'\n';

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 29 ms 3064 KB Output is correct
10 Execution timed out 1014 ms 2792 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 29 ms 3064 KB Output is correct
10 Execution timed out 1014 ms 2792 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 52 ms 11436 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 5468 KB Execution killed with signal 7
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 11860 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 5468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 57 ms 11768 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 29 ms 3064 KB Output is correct
10 Execution timed out 1014 ms 2792 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 29 ms 3064 KB Output is correct
10 Execution timed out 1014 ms 2792 KB Time limit exceeded
11 Halted 0 ms 0 KB -