LightOj 1387 - Setu
// Verdict:: Accepted
// Do some modify and get AC on the "Uva 12403-Save Satu" problem.
// Do some modify and get AC on the "Uva 12403-Save Satu" problem.
- #include <iostream>
- #include <cstdio>
- #include <cstring>
- #include <string>
- #include <vector>
- #include <cmath>
- #include <cctype>
- #include <set>
- #include <list>
- #include <stack>
- #include <queue>
- #include <algorithm>
- #define sf scanf
- #define pf printf
- #define L long
- #define LL long long
- #define N 10000
- #define nl puts("")
- #define MOD 10000000007
- #define pb push_back
- #define ps push
- #define clr clear
- #define bn begin()
- #define ed end()
- using namespace std;
- int main()
- {
- int tc,t,ar[101];
- char ch[8];
- sf("%d",&tc);
- for (t=1;t<=tc;t++)
- {
- int n,len=0;
- LL amount,r=0;
- sf("%d",&n);
- while(n--)
- {
- sf("%s",&ch);
- if(!strcmp(ch,"donate"))
- {
- sf("%lld",&amount);
- r+=amount;
- //ar[len++]=r;// c++;
- }
- else
- {
- ar[len++]=r;
- }
- }
- pf("Case %d:\n",t);
- for (int i=0;i<len;i++)pf("%d\n",ar[i]);
- }
- return 0;
- }
Comments
Post a Comment