Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
39535 | lihaocheng | 津津的储蓄计划 | C++ | Accepted | 0 MS | 248 KB | 319 | 2024-02-02 20:05:16 |
#include<iostream> using namespace std; int main(){ int n=0,x,s=0,a,b=0,y=1; for(int i=1;i<=12;i++) { cin>>x; n=n+300-x; if(n>=0) { s+=n/100*100; n%=100; } else if(y) { b=i; y=0; } } a=s*1.2+n; if(y) cout<<a; else cout<<-b; return 0; }