結果
| 問題 | No.2374 ASKT Subsequences |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-11 15:43:19 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 799 bytes |
| 記録 | |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 39,532 KB |
| 最終ジャッジ日時 | 2026-02-24 01:15:22 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 TLE * 1 -- * 5 |
ソースコード
#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;
}