QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#583344#9375. TouristkircoWA 4ms3840kbC++23634b2024-09-22 19:37:182024-09-22 19:37:20

Judging History

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

  • [2024-09-22 19:37:20]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3840kb
  • [2024-09-22 19:37:18]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define endl "\n"
#define iosy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define rop(i,a,n) for(int i=a;i<n;i++)
using namespace std;
const int inf = 0x3f3f3f3f3f3f3f3fLL;
const int N = 2e5+10;
const int MOD = 1e9+7;
void solve(){
	int n;cin>>n;
	vector<int> a(n+1);
	int ans=1500;
	int idx=-1;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		ans+=a[i];
		if(ans>=4000)idx=i;
	}
	if(idx==-1)cout<<"-1\n";
	else cout<<idx<<"\n";
}

signed main()
{
	iosy;
	int _t=1;
	//cin>>_t;
	while(_t--){
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1000 1000 1000 -5000 1000

output:

3

result:

ok single line: '3'

Test #2:

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

input:

5
20 -100 10 -150 5

output:

-1

result:

ok single line: '-1'

Test #3:

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

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'