結果

問題 No.398 ハーフパイプ(2)
ユーザー りあんりあん
提出日時 2016-07-15 03:30:49
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,404 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 26,156 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-05 02:38:51
合計ジャッジ時間 1,870 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:5: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
     scanf("%d.%d", &a, &b);
     ^~~~~
main.c:3:5: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:3:5: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:1:
+#include <stdio.h>
 int main() {
main.c:3:5:
     scanf("%d.%d", &a, &b);
     ^~~~~
main.c:32:5: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
     printf("%lld\n", ans);
     ^~~~~~
main.c:32:5: warning: incompatible implicit declaration of built-in function ‘printf’
main.c:32:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

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;
}
0