Submission #1325818


Source Code Expand

Copy
#pragma GCC optimize ("O3") // 最適化レベルの変更 O0〜O3 などを指定
#pragma GCC target ("avx") // ターゲットの変更 sse4, avx, avx2 など
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#include <stdio.h>

int a[200001];
int as[200001];
int main(void) {
    int n;
    scanf("%d",&n);
    int k;
    scanf("%d",&k);
    rep(i, n)
        scanf("%d",&a[i]);
    rep(i, n) {
        as[i+1] += as[i] + a[i];
    }

    long long ret = 0;
    rep(i, n) repi(j, i, n) {
        if ((as[j+1] - as[i]) >= k * (j - i + 1)) 
            ret++;
    }
    printf("%lld\n", ret);

    return 0;
}

Submission Info

Submission Time
Task E - Meaningful Mean
User hamko
Language C (GCC 5.4.1)
Score 0
Code Size 699 Byte
Status
Exec Time 2103 ms
Memory 1664 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:11:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ^
./Main.c:13:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&k);
     ^
./Main.c:15:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a[i]);
         ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 600
Status
× 3
× 5
× 2
× 16
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23
Case Name Status Exec Time Memory
a01 0 ms 128 KB
a02 0 ms 128 KB
a03 1 ms 128 KB
b04 1 ms 128 KB
b05 2103 ms 1664 KB
b06 2103 ms 1664 KB
b07 2103 ms 1664 KB
b08 2103 ms 1664 KB
b09 2103 ms 1664 KB
b10 2103 ms 1664 KB
b11 1 ms 128 KB
b12 1 ms 128 KB
b13 1201 ms 768 KB
b14 2103 ms 1664 KB
b15 2103 ms 1664 KB
b16 2103 ms 1664 KB
b17 2103 ms 1664 KB
b18 2103 ms 1664 KB
b19 2103 ms 1664 KB
b20 2103 ms 1664 KB
b21 2103 ms 1664 KB
b22 2103 ms 1664 KB
b23 2103 ms 1664 KB