QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#588500#9375. TouristmwhWA 0ms3644kbC++20298b2024-09-25 12:22:142024-09-25 12:22:14

Judging History

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

  • [2024-09-25 12:22:14]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3644kb
  • [2024-09-25 12:22:14]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
bool flag;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	long long n,m,ans;
	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;
}

詳細信息

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'