이 문제야 말로 정답률에 속지 마라! 문제.
자료형에 주의하자...후.......
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #include <stdio.h> int arr[1000011]; int main() { int N, A, B; int temp1 = 0, temp2 = 0, temp = 0; long long total = 0; scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%d", &arr[i]); scanf("%d %d", &A, &B); total = N; for (int j = 0; j < N; j++) { temp = arr[j] - A; if (temp > 0) { temp1 = temp / B; temp2 = temp % B; if (temp2 > 0) temp2 = 1; total += temp1 + temp2; } } printf("%lld\n",total); return 0; } | cs |
'SW 업무 관련 > 백준' 카테고리의 다른 글
[C언어] 2422. 한윤정이 이탈리아에 가서 아이스크림을 사먹는데 (1) | 2018.10.17 |
---|---|
[C언어] 2210. 숫자판 점프 (439) | 2018.10.17 |
[C언어] 15684. 사다리 조작 (474) | 2018.10.16 |
[C언어] 12100. 2048(EASY) (415) | 2018.10.15 |
[C언어] 15685. 드래곤 커브 (423) | 2018.10.14 |