QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#587024#9375. TouristgccWA 0ms3704kbC++20411b2024-09-24 17:10:152024-09-24 17:10:16

Judging History

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

  • [2024-09-24 17:10:16]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3704kb
  • [2024-09-24 17:10:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
	int n;
	cin >> n;
	vector<int>a(n + 1);
	int ben = 0;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
	}
	for(int i = 1; i <= n; i++){
		ben += a[i];
		if(ben >= 4000){
			cout << i << endl;
			return;
		}
	}
	cout << -1 << endl;
} 

int main(){
	int _;
	cin >> _;
	while(_--){
		solve();
	}
	return 0;
}

详细

Test #1:

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

input:

5
1000 1000 1000 -5000 1000

output:

-1
-1
-1
-1
-1

result:

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