QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#580818#9375. TouristtzwWA 0ms3644kbC++14267b2024-09-22 00:05:322024-09-22 00:05:36

Judging History

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

  • [2024-09-22 00:05:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3644kb
  • [2024-09-22 00:05:32]
  • 提交

answer

#include<iostream>
#define int long long
using namespace std;
signed main(){
	int n;
	cin>>n;
	int sum=0;
	int ans=-1;
	for(int i=1;i<=n;i++){
		int tmp;
		cin>>tmp;
		sum+=tmp;
		if(sum>=4000){
			ans=i;
			break;
		} 
	}
	cout<<ans;
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1000 1000 1000 -5000 1000

output:

-1

result:

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