AtCoder Grand Contest 004

Submission #1358101

Source codeソースコード

// Copyright 2017 wu_qing
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdint>
const int N = 2e3 + 10;
int n, a[N], b[N], x;
int64_t tot, ans = ~0ull >> 1;
int main() {
    memset(b, 127, sizeof b);
    scanf("%d%d", &n, &x);
    for (int i = 0; i < n; i++)
        scanf("%d", a + i);
    for (int i = 0; i < n; i++) {
        tot = i * x;
        for (int j = 0; j < n; j++)
            tot += (b[j] = std::min(b[j], a[(j - i + n) % n]));
        ans = std::min(ans, tot);
    }
    printf("%lld\n", ans);
    return 0;
}

Submission

Task問題 B - Colorful Slimes
User nameユーザ名 wu_qing
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 570 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:20:25: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t {aka long int}’ [-Wformat=]
printf("%lld\n", ans);
^
./Main.cpp:11:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &n, &x);
^
./Main.cpp:13:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", a + i);
^

Test case

Set

Set name Score得点 / Max score Cases
Sample - 0_00.txt,0_01.txt,0_02.txt
All 0 / 400 0_00.txt,0_01.txt,0_02.txt,1_00.txt,1_01.txt,1_02.txt,1_03.txt,1_04.txt,1_05.txt,1_06.txt,1_07.txt,1_08.txt,1_09.txt,1_10.txt,1_11.txt,1_12.txt,1_13.txt,1_14.txt,1_15.txt,1_16.txt,1_17.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
0_00.txt AC 1 ms 128 KB
0_01.txt AC 1 ms 128 KB
0_02.txt AC 1 ms 128 KB
1_00.txt AC 15 ms 256 KB
1_01.txt WA
1_02.txt AC 15 ms 128 KB
1_03.txt WA
1_04.txt WA
1_05.txt WA
1_06.txt WA
1_07.txt WA
1_08.txt WA
1_09.txt WA
1_10.txt AC 11 ms 128 KB
1_11.txt AC 15 ms 128 KB
1_12.txt WA
1_13.txt WA
1_14.txt WA
1_15.txt AC 12 ms 128 KB
1_16.txt WA
1_17.txt AC 15 ms 128 KB