Contest Duration: ~ (local time) (120 minutes) Back to Home

Submission #210099

Source Code Expand

Copy
```#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rrep(i,n) for(int i=(int)(n)-1; i>=0; i--)
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define pr(a) cout << (a) << endl
#define PR(a,b) cout << (a) << " " << (b) << endl
#define F first
#define S second
typedef long long ll;
typedef pair<ll,ll> P;
const int MAX=1000000001;
const ll MAXL=1000000000000000001LL;
const ll mod=1000000007;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

queue<P> que;
int main() {
ll ans=0;
string s;
cin >> s;
int now=5,k=-1,p=0;
rep(i,s.size()) {
if(p==0) {
if(s[i]=='N' && now) {
if(k<0) ans+=10;
else ans+=(double)10*((double)1+floor((double)k/10)*0.1);
k++;
now--;
que.push(P(i+6,1));
} else if(s[i]=='C' && now>2) {
if(k<0) ans+=50;
else ans+=(double)50*((double)1+floor((double)k/10)*0.1);
k++;
now-=3;
que.push(P(i+8,3));
p=2;
}
} else p--;
if(!que.empty() && que.front().F==i) {
now+=que.front().S;
que.pop();
}
}
pr(ans);
return 0;
}
```

#### Submission Info

Submission Time 2014-08-09 21:36:43+0900 B - かぶりん！ s1200008 C++ (G++ 4.6.4) 0 1272 Byte WA 86 ms 1896 KB

#### Test Cases

Set Name Score / Max Score Test Cases
All 0 / 50 00_sample00.txt, 00_sample01.txt, 00_sample02.txt, 00_small00.txt, 00_small01.txt, 00_small02.txt, 00_small03.txt, 00_small04.txt, 00_small05.txt, 00_small06.txt, 00_small07.txt, 00_small08.txt, 00_small09.txt, 00_small10.txt, 00_small11.txt, 00_small12.txt, 00_small13.txt, 00_small14.txt, 00_small15.txt, 00_small16.txt, 00_small17.txt, 00_small18.txt, 00_small19.txt, 00_small20.txt, 00_small21.txt, 00_small22.txt, 00_small23.txt, 00_small24.txt, 00_small25.txt, 00_small26.txt, 00_small27.txt, 00_small28.txt, 00_small29.txt, 01_medium00.txt, 01_medium01.txt, 01_medium02.txt, 01_medium03.txt, 01_medium04.txt, 01_medium05.txt, 01_medium06.txt, 01_medium07.txt, 01_medium08.txt, 01_medium09.txt, 01_medium10.txt, 01_medium11.txt, 01_medium12.txt, 01_medium13.txt, 01_medium14.txt, 01_medium15.txt, 01_medium16.txt, 01_medium17.txt, 01_medium18.txt, 01_medium19.txt, 01_medium20.txt, 01_medium21.txt, 01_medium22.txt, 01_medium23.txt, 01_medium24.txt, 01_medium25.txt, 01_medium26.txt, 01_medium27.txt, 01_medium28.txt, 01_medium29.txt, 02_large00.txt, 02_large01.txt, 02_large02.txt, 02_large03.txt, 02_large04.txt, 02_large05.txt, 02_large06.txt, 02_large07.txt, 02_large08.txt, 02_large09.txt, 02_large10.txt, 02_large11.txt, 02_large12.txt, 02_large13.txt, 02_large14.txt, 02_large15.txt, 02_large16.txt, 02_large17.txt, 02_large18.txt, 02_large19.txt, 02_large20.txt, 02_large21.txt, 02_large22.txt, 02_large23.txt, 02_large24.txt, 02_large25.txt, 02_large26.txt, 02_large27.txt, 02_large28.txt, 02_large29.txt, 03_manual00.txt, 03_manual01.txt, 03_manual02.txt, 03_manual03.txt
Case Name Status Exec Time Memory
00_sample00.txt 23 ms 808 KB
00_sample01.txt 21 ms 928 KB
00_sample02.txt 21 ms 800 KB
00_small00.txt 21 ms 804 KB
00_small01.txt 21 ms 800 KB
00_small02.txt 21 ms 796 KB
00_small03.txt 21 ms 804 KB
00_small04.txt 21 ms 928 KB
00_small05.txt 22 ms 804 KB
00_small06.txt 22 ms 804 KB
00_small07.txt 21 ms 732 KB
00_small08.txt 30 ms 928 KB
00_small09.txt 21 ms 796 KB
00_small10.txt 21 ms 800 KB
00_small11.txt 20 ms 924 KB
00_small12.txt 20 ms 928 KB
00_small13.txt 22 ms 804 KB
00_small14.txt 21 ms 676 KB
00_small15.txt 21 ms 756 KB
00_small16.txt 21 ms 928 KB
00_small17.txt 21 ms 928 KB
00_small18.txt 21 ms 804 KB
00_small19.txt 21 ms 924 KB
00_small20.txt 22 ms 772 KB
00_small21.txt 21 ms 736 KB
00_small22.txt 21 ms 844 KB
00_small23.txt 21 ms 764 KB
00_small24.txt 20 ms 800 KB
00_small25.txt 21 ms 804 KB
00_small26.txt 21 ms 920 KB
00_small27.txt 20 ms 800 KB
00_small28.txt 20 ms 796 KB
00_small29.txt 20 ms 928 KB
01_medium00.txt 22 ms 800 KB
01_medium01.txt 21 ms 924 KB
01_medium02.txt 20 ms 800 KB
01_medium03.txt 20 ms 920 KB
01_medium04.txt 22 ms 796 KB
01_medium05.txt 22 ms 800 KB
01_medium06.txt 20 ms 928 KB
01_medium07.txt 21 ms 792 KB
01_medium08.txt 21 ms 800 KB
01_medium09.txt 21 ms 760 KB
01_medium10.txt 22 ms 928 KB
01_medium11.txt 22 ms 800 KB
01_medium12.txt 23 ms 800 KB
01_medium13.txt 21 ms 844 KB
01_medium14.txt 21 ms 928 KB
01_medium15.txt 27 ms 924 KB
01_medium16.txt 22 ms 928 KB
01_medium17.txt 22 ms 816 KB
01_medium18.txt 21 ms 800 KB
01_medium19.txt 22 ms 924 KB
01_medium20.txt 21 ms 796 KB
01_medium21.txt 20 ms 796 KB
01_medium22.txt 20 ms 924 KB
01_medium23.txt 22 ms 924 KB
01_medium24.txt 22 ms 928 KB
01_medium25.txt 21 ms 812 KB
01_medium26.txt 20 ms 800 KB
01_medium27.txt 20 ms 800 KB
01_medium28.txt 21 ms 796 KB
01_medium29.txt 21 ms 804 KB
02_large00.txt 63 ms 1836 KB
02_large01.txt 56 ms 1836 KB
02_large02.txt 39 ms 1376 KB
02_large03.txt 82 ms 1896 KB
02_large04.txt 52 ms 1320 KB
02_large05.txt 56 ms 1832 KB
02_large06.txt 31 ms 1064 KB
02_large07.txt 79 ms 1832 KB
02_large08.txt 59 ms 1828 KB
02_large09.txt 44 ms 1328 KB
02_large10.txt 79 ms 1832 KB
02_large11.txt 23 ms 736 KB
02_large12.txt 28 ms 932 KB
02_large13.txt 43 ms 1548 KB
02_large14.txt 54 ms 1320 KB
02_large15.txt 55 ms 1840 KB
02_large16.txt 61 ms 1828 KB
02_large17.txt 29 ms 1012 KB
02_large18.txt 41 ms 1320 KB
02_large19.txt 79 ms 1840 KB
02_large20.txt 22 ms 800 KB
02_large21.txt 37 ms 1188 KB
02_large22.txt 26 ms 808 KB
02_large23.txt 66 ms 1828 KB
02_large24.txt 40 ms 1328 KB
02_large25.txt 42 ms 1316 KB
02_large26.txt 28 ms 940 KB
02_large27.txt 65 ms 1844 KB
02_large28.txt 51 ms 1320 KB
02_large29.txt 68 ms 1828 KB
03_manual00.txt 86 ms 1836 KB
03_manual01.txt 74 ms 1832 KB
03_manual02.txt 73 ms 1820 KB
03_manual03.txt 21 ms 932 KB