답안 #1041596

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1041596 2024-08-02T06:03:32 Z 김은성(#11000) Brought Down the Grading Server? (CEOI23_balance) C++17
0 / 100
2000 ms 13136 KB
#include <bits/stdc++.h>
using namespace std;
int n, s, t, *a[100009];
vector<pair<int, int> > graph[100009];
int ans[100009];
void findcycle(int v){
	for(auto [idx, u]: graph[v]){
		if(ans[idx] != -1)
			continue;
		ans[idx] = v;
		findcycle(u);
	}
}
int main(){
	int i, j;
	scanf("%d %d %d", &n, &s, &t);
	memset(ans, -1, sizeof(ans));
	for(i=0; i<n; i++){
		a[i] = (int*)malloc(s * sizeof(int));
		for(j=0; j<s; j++){
			scanf("%d", &a[i][j]);
		}
		graph[a[i][0]].push_back(make_pair(i, a[i][1]));
		graph[a[i][1]].push_back(make_pair(i, a[i][0]));
	}
	for(i=0; i<n; i++){
		findcycle(i);
	}
	for(i=0; i<n; i++){
		printf("%d %d\n", ans[i], a[i][0] + a[i][1] - ans[i]);
	}
}

Compilation message

balance.cpp: In function 'int main()':
balance.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |  scanf("%d %d %d", &n, &s, &t);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
balance.cpp:21:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |    scanf("%d", &a[i][j]);
      |    ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3320 KB Correct
2 Incorrect 1 ms 3164 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3416 KB Correct
2 Incorrect 1 ms 3164 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 13136 KB Correct
2 Correct 756 ms 12748 KB Correct
3 Correct 90 ms 11708 KB Correct
4 Correct 1619 ms 11188 KB Correct
5 Execution timed out 2062 ms 11400 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 13136 KB Correct
2 Correct 756 ms 12748 KB Correct
3 Correct 90 ms 11708 KB Correct
4 Correct 1619 ms 11188 KB Correct
5 Execution timed out 2062 ms 11400 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3416 KB Correct
2 Incorrect 1 ms 3164 KB maximum and minimum number of simultaneously evaluated submissions for any single task differ more than one
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 3160 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 3160 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 3160 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 13136 KB Correct
2 Correct 756 ms 12748 KB Correct
3 Correct 90 ms 11708 KB Correct
4 Correct 1619 ms 11188 KB Correct
5 Execution timed out 2062 ms 11400 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 13136 KB Correct
2 Correct 756 ms 12748 KB Correct
3 Correct 90 ms 11708 KB Correct
4 Correct 1619 ms 11188 KB Correct
5 Execution timed out 2062 ms 11400 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3320 KB Correct
2 Incorrect 1 ms 3164 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -