답안 #79818

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
79818 2018-10-16T15:40:36 Z pzdba Cezar (COCI17_cezar) C++14
50 / 50
2 ms 800 KB
#include <bits/stdc++.h>
using namespace std;
int dp[12];
int main(){
	int n, a, sum = 0;
	scanf("%d", &n);
	bool ok = 1;
	for(int i=1;i<=n;i++){
		scanf("%d", &a);
		sum += a;
		dp[a]++;
		if(dp[a] > 4) ok = 0;
	}
	if(sum >= 20) ok = 0;
	if(!ok) return !printf("DOSTA\n");
	sum = 21-sum;
	int tot = 0;
	for(int i=2;i<=min(sum, 11);i++){
		tot += 4-dp[i];
	}
	if(52 - n - tot >= tot) printf("DOSTA\n");
	else printf("VUCI\n");
}

Compilation message

cezar.cpp: In function 'int main()':
cezar.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
cezar.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a);
   ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 520 KB Output is correct
2 Correct 2 ms 540 KB Output is correct
3 Correct 2 ms 584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 584 KB Output is correct
2 Correct 2 ms 584 KB Output is correct
3 Correct 2 ms 652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 652 KB Output is correct
2 Correct 2 ms 704 KB Output is correct
3 Correct 2 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 760 KB Output is correct
2 Correct 2 ms 760 KB Output is correct
3 Correct 2 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 760 KB Output is correct
2 Correct 2 ms 760 KB Output is correct
3 Correct 2 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 800 KB Output is correct
2 Correct 2 ms 800 KB Output is correct
3 Correct 2 ms 800 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 800 KB Output is correct
2 Correct 2 ms 800 KB Output is correct
3 Correct 2 ms 800 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 800 KB Output is correct
2 Correct 2 ms 800 KB Output is correct
3 Correct 2 ms 800 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 800 KB Output is correct
2 Correct 2 ms 800 KB Output is correct
3 Correct 2 ms 800 KB Output is correct