QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#526311#8774. Manhattan Walkmegumi#WA 0ms3532kbC++14585b2024-08-21 13:17:122024-08-21 13:17:12

Judging History

你现在查看的是最新测评结果

  • [2024-08-21 13:17:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2024-08-21 13:17:12]
  • 提交

answer


#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 998244353;
inline int read() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
        f = (c == '-') ? -1 : 1, c = getchar();
    while (c >= '0' && c <= '9')
        x = x * 10 + c - 48, c = getchar();
    return f * x;
}
signed main() {
    int n = read(), p = read(), ans = 0;
    for (int i = 1; i <= n; i++) {
        int x = read();
        if (p / x <= ans)
            cout << i - 1, exit(0);
        ans += x;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3532kb

input:

2 3 8

output:

0

result:

wrong answer 1st numbers differ - expected: '2.8750000', found: '0.0000000', error = '1.0000000'