QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#581316 | #9375. Tourist | 15H | AC ✓ | 9ms | 3704kb | C++14 | 1.5kb | 2024-09-22 11:50:21 | 2024-09-22 11:50:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define desc greater<int>
#define sz(v) (int)v.size()
#define sc(a) cout<<a<<endl;return
#define all(v) v.begin(),v.end()
#define popcount __builtin_popcount
#define mem(a,v) memset(a,(v),sizeof(a))
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define rep_(i,a,b) for(int i=a;i>=b;i--)
#define de(a) cerr<<"DEBUG:"<<(a)<<'\n'
#define de2(a,b) cerr<<"DEBUG:"<<(a)<<' '<<(b)<<'\n'
#define SET(a) cout<<fixed<<setprecision((a))
#define Mint(x) x=(x%mod+mod)%mod
#define endl '\n'
#define eps 1e-6
#define PI acos(-1)
const int inf = INT_MAX;
const ll INF = 0x3f3f3f3f3f3f3f3f;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
bool isprime(ll x){for(ll i=2;i*i<=x;i++){if(x%i==0) return 0;}return 1;}
ll qpow(ll a,ll b,ll p=INF){ll s=1;while(b){if(b&1)s=(s*a)%p;b>>=1;a=(a*a)%p;}return s;}
const int N = 2e6+10,M=N;
const int mod=998244353;
// typedef modint<mod> mint;
#define int ll
void solve(){
int sum=1500,ans=-1;
int n;cin>>n;
rep(i,1,n){
int x;
cin>>x;
if((sum+=x)>=4000 and ans==-1){
ans=i;
}
}
cout<<ans<<endl;
}
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
int T = 1;
// cin >> T;
rep(_,1,T){
// cout<<"Case #"<<_<<": ";
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
input:
5 1000 1000 1000 -5000 1000
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
5 20 -100 10 -150 5
output:
-1
result:
ok single line: '-1'
Test #3:
score: 0
Accepted
time: 8ms
memory: 3588kb
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: 0
Accepted
time: 9ms
memory: 3704kb
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:
54
result:
ok single line: '54'
Test #5:
score: 0
Accepted
time: 4ms
memory: 3576kb
input:
100000 -2 -5 -5 1 2 -5 -1 1 -5 1 -5 -5 -5 -5 -5 -5 -5 -3 -5 -2 -5 3 0 1 3 -1 0 -3 1 1 -1 0 -2 -5 -4 3 -1 -3 -5 3 -5 -5 -3 -3 2 -3 -5 -1 -5 -5 0 -1 -1 1 3 1 -1 -4 -3 4 0 -5 3 3 1 2 3 -2 -4 1 -1 -5 -1 3 -3 -1 -5 -5 -5 0 -1 -5 -5 -1 -5 -5 0 -3 3 -5 -5 1 -5 0 0 1 -1 -3 -1 4 2 -5 3 -3 -4 -1 3 -5 1 0 0 -5...
output:
-1
result:
ok single line: '-1'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3580kb
input:
100000 -5 3 3 -5 -2 2 -3 0 4 -5 3 3 3 -5 0 -3 1 2 -3 -1 -2 -5 -3 -5 3 -5 -1 3 0 -5 -4 -1 -3 4 -4 -1 -5 -5 3 -5 -1 -5 -5 -1 0 -5 -3 -5 -5 -1 1 -3 -1 -3 -5 2 -5 -3 -3 0 3 -4 2 3 -1 -1 -5 1 -1 -3 1 3 -2 0 -5 1 -5 -2 -1 -1 -4 2 -1 1 1 -2 0 -5 4 -3 -4 3 -5 -5 2 -1 4 -5 4 -3 3 4 -2 -5 -3 -5 0 -3 3 -5 1 -5...
output:
-1
result:
ok single line: '-1'
Test #7:
score: 0
Accepted
time: 4ms
memory: 3640kb
input:
100000 -1 -1 -1 -1 -1 -1 -1 0 -1 0 -1 0 0 -1 0 0 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 0 -1 -1 0 -1 0 -1 0 -1 0 -1 -1 -1 -1 0 -1 0 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -...
output:
-1
result:
ok single line: '-1'
Test #8:
score: 0
Accepted
time: 4ms
memory: 3544kb
input:
100000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 0 0 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 0 0 -1 0 0 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 0 -1 -1 -1 0 -1 -1 -1 -1 0 0 -1 0 0 -1 -1 0 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 0 -1...
output:
-1
result:
ok single line: '-1'
Test #9:
score: 0
Accepted
time: 6ms
memory: 3568kb
input:
100000 -224748433 -364919841 -787787776 -545395220 -74471475 -175298007 -602380432 -833262011 -908461729 -668548732 -351987167 -290853718 -435834433 -408836792 -779369850 -236528552 -587189486 -312568767 -546460268 -844783278 -893792984 -78354114 -79596680 -487016826 -875448745 -573277560 -310459110...
output:
66644
result:
ok single line: '66644'
Test #10:
score: 0
Accepted
time: 7ms
memory: 3548kb
input:
100000 -6165888 -92523008 -685094401 -346315482 -437894608 -458827356 -649330428 -117492458 -689332880 -81255318 -977682270 -644453376 -225267810 -812914938 -752589184 -386629868 -493815808 -351983124 -41767556 -89654452 -815755942 -305527783 -593596324 -365394378 -76388080 -16250205 -538476942 -328...
output:
-1
result:
ok single line: '-1'
Test #11:
score: 0
Accepted
time: 3ms
memory: 3556kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
2500
result:
ok single line: '2500'
Extra Test:
score: 0
Extra Test Passed