template<classT>voidread(T&num) {charCH;boolF=false;for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar());for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar()); F&& (num=-num); }intstk[70], tp; template<classT> inlinevoidprint(T p) {if(!p) ...
CodeForces 686A Free Ice Cream (水题模拟) 目录 题意:给定初始数量的冰激凌,然后n个操作,如果是“+”,那么数量就会增加,如果是“-”,如果现有的数量大于等于要减的数量,那么就减掉,如果小于, 那么孩子就会离家。问你最后剩下多少冰激凌,和出走的孩子数量。 析:多水的一个题,就是一个模拟,如果是+,就加上,...
After their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer. x dice cream packs comes to the house, then Kay and Gerda take all his packs. If a child who wants to takedice cream packs comes to the house, then ...
View Post CodeForces 686A-Free Ice Cream 题目: 儿童排队领冰激凌,给你两个数n,x分别代表接下来有n行与初始的冰激淋数;接下来n行,每行有一个字符('+'or‘-’),还有一个整数d,+d表示新增的冰激 凌数(由搬运工搬运到此),-d表示儿童将要领走的冰激凌数(当剩余的数量有足够这么多时),求没领到冰激凌的儿...