結果
| 問題 |
No.398 ハーフパイプ(2)
|
| コンテスト | |
| ユーザー |
りあん
|
| 提出日時 | 2016-07-15 03:30:49 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 1,404 bytes |
| コンパイル時間 | 1,013 ms |
| コンパイル使用メモリ | 22,576 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 00:29:34 |
| 合計ジャッジ時間 | 1,753 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:5: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
3 | scanf("%d.%d", &a, &b);
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | int main() {
main.c:3:5: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
3 | scanf("%d.%d", &a, &b);
| ^~~~~
main.c:3:5: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:32:5: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
32 | printf("%lld\n", ans);
| ^~~~~~
main.c:32:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:32:5: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
main.c:32:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
int main() {
int a, b;
scanf("%d.%d", &a, &b);
int sum = (a * 100 + b) / 25;
long long ans = 0;
for (int i = 0; i < 101; ++i) {
for (int j = i; j < 101; ++j) {
for (int k = j; k < 101; ++k) {
int l = sum - i - j - k;
if (l < 0 || l > 100) continue;
if (i < j && j < k && k < l)
ans += 180 + (i + 100 - l) * 360 + i * (100 - l) * 720;
if (i == j && j < k && k < l)
ans += 60 + i * 180 + (100 - l) * 120 + i * (100 - l) * 360;
if (i < j && j == k && k < l)
ans += 90 + (i + 100 - l) * 180 + i * (100 - l) * 360;
if (i < j && j < k && k == l)
ans += 60 + i * 120 + (100 - l) * 180 + i * (100 - l) * 360;
if (i == j && j < k && k == l)
ans += 20 + (i + 100 - l) * 60 + i * (100 - l) * 180;
if (i == j && j == k && k < l)
ans += 15 + i * 60 + (100 - l) * 30 + i * (100 - l) * 120;
if (i < j && j == k && k == l)
ans += 15 + i * 30 + (100 - l) * 60 + i * (100 - l) * 120;
if (i == j && j == k && k == l)
ans += 1 + (i + 100 - l) * 6 + i * (100 - l) * 30;
}
}
}
printf("%lld\n", ans);
return 0;
}
りあん