/ CYOJ /

记录详情

Accepted

foo.cc: In function 'int main()':
foo.cc:4:13: warning: unused variable 'sum' [-Wunused-variable]
    4 |         int sum=0,save=0,give=0;
      |             ^~~
foo.cc:5:14: warning: variable 'io' set but not used [-Wunused-but-set-variable]
    5 |         bool io=1;
      |              ^~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 3ms 384.0 KiB
#2 Accepted 3ms 256.0 KiB
#3 Accepted 3ms 256.0 KiB
#4 Accepted 3ms 256.0 KiB
#5 Accepted 3ms 256.0 KiB
#6 Accepted 4ms 256.0 KiB
#7 Accepted 3ms 256.0 KiB
#8 Accepted 3ms 256.0 KiB
#9 Accepted 3ms 256.0 KiB
#10 Accepted 2ms 256.0 KiB

代码

#include<iostream>
using namespace std;
int main(){
	int sum=0,save=0,give=0;
	bool io=1;
	for(int i=1;i<=12;i++){
		int num;
		cin>>num;
		save=save+300-num;
		if(save<0)
		{
			cout<<-i;
			io=0;
			return 0;
		}
		if(save/100)
		{
			give+=save/100*100;
			save-=save/100*100;
		}
		
	}
	cout<<1.2*give+save;
	return 0;
}

信息

递交者
类型
递交
题目
P1011 津津的储蓄计划
语言
C++
递交时间
2022-08-26 17:06:24
评测时间
2022-08-26 17:06:24
评测机
分数
100
总耗时
35ms
峰值内存
384.0 KiB