QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#588504#9375. TouristmwhWA 7ms3648kbC++20320b2024-09-25 12:26:372024-09-25 12:26:38

Judging History

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

  • [2024-09-25 12:26:38]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3648kb
  • [2024-09-25 12:26:37]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	long long n,m,ans=1500;
	cin>>n;
	bool flag=false;
	for(int i=0;i<n;i++){
		long long a;
		cin>>a;
		ans+=a;
		if(ans>=4000)flag=true,m=i+1;
	}
	if(flag)cout<<m;
	else cout<<-1;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1000 1000 1000 -5000 1000

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

5
20 -100 10 -150 5

output:

-1

result:

ok single line: '-1'

Test #3:

score: -100
Wrong Answer
time: 7ms
memory: 3592kb

input:

100000
-622469318 539497462 -644931120 58116512 -531587090 908494982 839175844 702577848 -359659596 -940595076 -625597008 475756588 -944333680 -836413428 15282479 465161640 368734488 -915470952 168906352 507919069 -120921946 69204544 -142419900 -256757690 -773656014 194185932 398352052 550384408 -45...

output:

100000

result:

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