답안 #42290

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
42290 2018-02-25T13:23:07 Z milmillin Cezar (COCI17_cezar) C++14
50 / 50
3 ms 604 KB
#include <cstdio>

using namespace std;

int cnt[12];

int main () {
	cnt[2]=4;
	cnt[3]=4;
	cnt[4]=4;
	cnt[5]=4;
	cnt[6]=4;
	cnt[7]=4;
	cnt[8]=4;
	cnt[9]=4;
	cnt[10]=12;
	cnt[11]=4;

	int n;
	scanf("%d",&n);
	int x;
	int sum=21;
	for (int i=0;i<n;i++) {
		scanf("%d",&x);
		cnt[x]--;
		sum-=x;
	}
	int rmd=0;
	for (int i=sum;i<=11;i++) {
		rmd+=cnt[i];
	}
	int xx=0;
	for (int i=1;i<=sum;i++) {
		xx+=cnt[i];
	}
	if (rmd>=xx) {
		printf("DOSTA\n");
	} else {
		printf("VUCI\n");
	}
	return 0;
}

Compilation message

cezar.cpp: In function 'int main()':
cezar.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
cezar.cpp:24:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&x);
   ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 272 KB Output is correct
2 Correct 2 ms 356 KB Output is correct
3 Correct 2 ms 432 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 480 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 516 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 516 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 3 ms 516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 516 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 516 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 516 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct