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]);
         ^

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 0 / 600 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
b06
b07
b08
b09
b10
b11 1 ms 128 KB
b12 1 ms 128 KB
b13 1201 ms 768 KB
b14
b15
b16
b17
b18
b19
b20
b21
b22
b23