- [NOIP 2004 提高组] 津津的储蓄计划
有哪位大佬知道我的代码为什么WA吗?
- @ 2026-2-27 8:56:47
问了AI,说是正确的,可递交还是不对

#include<bits/stdc++.h>
using namespace std;
int main(){
int ans=0,cq=0;
for(int i=1;i<=12;i++)
{
int n;
cin>>n;
if(ans+300<n)
{
cout<<-i<<endl;
return 0;
}
cq+=(ans+300-n)/100*100;
ans+=(ans+300-n)%100;
}
cout<<cq/5*6+ans<<endl;
return 0;
}
0 comments
No comments so far...
Information
- ID
- 5147
- Time
- ms
- Memory
- MiB
- Difficulty
- 1
- Tags
- # Submissions
- 1313
- Accepted
- 551
- Uploaded By