QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#590865#8777. Passport StampsForever_Young#WA 4ms3832kbC++23492b2024-09-26 12:14:062024-09-26 12:14:07

Judging History

This is the latest submission verdict.

  • [2024-09-26 12:14:07]
  • Judged
  • Verdict: WA
  • Time: 4ms
  • Memory: 3832kb
  • [2024-09-26 12:14:06]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define data dataa
using LL=long long;
using ULL=unsigned long long;
using LD=long double;
LL p;
int n;
int main()
{
    scanf("%d%lld",&n,&p);
    __int128 sum=0;
    rep(i,n)
    {
        LL c;scanf("%lld",&c);
        if(sum+c>p||sum+(i-1)*(c-1)>=p){printf("%d\n",i-1);return 0;}
        sum+=c;
    }
    printf("%d\n",n);
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3792kb

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 4ms
memory: 3832kb

input:

100000 559309580160692839
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

84437

result:

ok single line: '84437'

Test #3:

score: -100
Wrong Answer
time: 4ms
memory: 3748kb

input:

100000 890934113082207108
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

100000

result:

wrong answer 1st lines differ - expected: '53636', found: '100000'