提出 #9831279
ソースコード 拡げる
#include <stdio.h>
#include <inttypes.h>
int64_t zettaiti(int64_t asumikana) {
return asumikana < 0 ? -asumikana : asumikana;
}
int main(void) {
int N;
int64_t T, A;
int64_t H[1024];
int i;
int bestIndex;
int64_t bestDiff;
if (scanf("%d", &N) != 1) return 1;
if (scanf("%" SCNd64 "%" SCNd64, &T, &A) != 2) return 1;
T *= 1000;
A *= 1000;
for (i = 0; i < N; i++) {
if (scanf("%" SCNd64, &H[i]) != 1) return 1;
H[i] *= 1000;
}
bestIndex = 0;
bestDiff = zettaiti(A - (T - H[0] * 6));
for (i = 1; i < N; i++) {
int64_t score = zettaiti(A - (T - H[i] * 6));
if (score < bestDiff) {
bestIndex = i;
bestDiff = score;
}
}
printf("%d\n", bestIndex + 1);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Palace |
| ユーザ | mikecat |
| 言語 | C (GCC 5.4.1) |
| 得点 | 0 |
| コード長 | 728 Byte |
| 結果 | WA |
| 実行時間 | 1 ms |
| メモリ | 128 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 200 | ||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | WA | 1 ms | 128 KiB |
| 02.txt | AC | 1 ms | 128 KiB |
| 03.txt | AC | 1 ms | 128 KiB |
| 04.txt | WA | 1 ms | 128 KiB |
| 05.txt | WA | 1 ms | 128 KiB |
| 06.txt | AC | 1 ms | 128 KiB |
| 07.txt | WA | 1 ms | 128 KiB |
| 08.txt | WA | 1 ms | 128 KiB |
| 09.txt | WA | 1 ms | 128 KiB |
| 10.txt | WA | 1 ms | 128 KiB |
| sample_01.txt | AC | 1 ms | 128 KiB |
| sample_02.txt | AC | 1 ms | 128 KiB |