神犇们救我(WA)

P1089 [NOIP2004 提高组] 津津的储蓄计划

@[zhangxuecheng](/user/1012807) 代码?
by rnfmabj5114 @ 2023-05-27 18:59:05


``` #include<iostream> using namespace std; int main(){ int a; unsigned int temp; int sum=0; for(int i=1;i<=12;i++){ cin>>a; temp=300-a%100; sum=sum+temp*100; if(a+sum>300){ cout<<"-"<<i; break; } } return 0; } ```
by zhangxuecheng @ 2023-05-27 18:59:53


??
by wangrongxi @ 2023-05-27 20:45:57


```cpp #include<iostream> using namespace std; int main(){ int z=0,c=0; for(int i=1;i<=12;i++){ int x; cin>>x; z+=300; if(z<x){ cout<<"-"<<i; return 0; } z-=x; c+=(z/100)*100; z%=100; } cout<<int(double(c)*1.2)+z; return 0; } ```
by Terry2011 @ 2023-06-01 16:48:28


@[Terry2011](/user/993331) 我看懂了
by gaozitong @ 2023-06-10 09:26:41


@[gaozitong](/user/991647) 嗯嗯
by Terry2011 @ 2023-06-10 11:25:35


|