QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#580136#9375. TouristJEdwardWA 1ms3740kbC++20703b2024-09-21 20:13:542024-09-21 20:13:54

Judging History

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

  • [2024-09-21 20:13:54]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3740kb
  • [2024-09-21 20:13:54]
  • 提交

answer

#include <bits/stdc++.h>
#define pii pair<int, int>
using namespace std;
const int N = 5e5 + 5;
const int INF = 1e9 + 7;

mt19937 rnd(chrono::duration_cast<chrono::nanoseconds>(chrono::system_clock::now().time_since_epoch()).count());
int randint(int L, int R){
	uniform_int_distribution<int> dist(L, R);
	return dist(rnd);
}

int n;
inline void sol(){
	cin >> n;
	int ans = 1500;
	for(int i=1;i<=n;i++){
		int x;
		cin >> x;
		ans += x;
		if(ans >= 4000){
			return cout << i << endl, void();
		}
	}
	cout << -1;
}

signed main()
{
    ios::sync_with_stdio(0), cin.tie(0);
    int tc = 1;
//    cin >> tc;
    while (tc--)
    {
        sol();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1000 1000 1000 -5000 1000

output:

3

result:

ok single line: '3'

Test #2:

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

input:

5
20 -100 10 -150 5

output:

-1

result:

ok single line: '-1'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3568kb

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:

7

result:

ok single line: '7'

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 3652kb

input:

100000
-22223976 -142152966 -699451000 -867380652 -806775044 -184464736 193157905 83719408 119052656 912359844 627391168 626102176 -307686144 -193929406 -758255267 408690212 -441709509 825087291 113886978 -348059815 -298920520 -298801588 -235809714 257817681 503204186 -846346276 -674436380 -84108390...

output:

5

result:

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