結果

問題 No.2374 ASKT Subsequences
ユーザー HimatsubushinHimatsubushin
提出日時 2023-07-11 15:43:19
言語 C90
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 799 bytes
コンパイル時間 852 ms
コンパイル使用メモリ 25,156 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-11 06:44:11
合計ジャッジ時間 7,756 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 0 ms
4,352 KB
testcase_02 AC 0 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 0 ms
4,356 KB
testcase_06 AC 0 ms
4,356 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 0 ms
4,352 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 1 ms
4,352 KB
testcase_14 AC 5 ms
4,352 KB
testcase_15 AC 10 ms
4,352 KB
testcase_16 AC 3 ms
4,348 KB
testcase_17 AC 19 ms
4,352 KB
testcase_18 AC 68 ms
4,352 KB
testcase_19 AC 51 ms
4,348 KB
testcase_20 AC 148 ms
4,352 KB
testcase_21 AC 220 ms
4,352 KB
testcase_22 AC 109 ms
4,352 KB
testcase_23 AC 71 ms
4,352 KB
testcase_24 AC 70 ms
4,348 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

#define N 2000

int main(void) {
    int a, b, c, d, k1, k2, k3, i, n, count, x[N];

    scanf("%d", &n);
    for (i = 0; i < n; i++)
        scanf("%d", &x[i]);

    count = 0;
    for (a = 0; a < n - 3; a++) {
        for (b = a + 1; b < n - 2; b++) {
            k1 = x[b] - x[a] - 10;
            if (k1 <= 0)
                continue;
            for (c = b + 1; c < n - 1; c++) {
                k2 = x[b] - x[c];
                if (k1 != k2)
                    continue;
                for (d = c + 1; d < n; d++) {
                    k3 = x[d] - x[c] - 1;
                    if (k1 == k3)
                        count++;
                }
            }
        }
    }

    printf("%d\n", count);

    return EXIT_SUCCESS;
}
0