Submission #117323


Source Code Expand

#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <list>
#include <cassert>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define EPS 1e-9
using namespace std;
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii;
typedef long long ll; typedef vector<long long> vl; typedef pair<long long,long long> pll; typedef vector<pair<long long,long long> > vpll;
typedef vector<string> vs; typedef long double ld;

int main() {
	int N, T;
	cin >> N >> T;
	T -= T / 10;
	ll ratesum = 0, aliciasum = 0;
	rep(i, N) {
		string name; char rarity; int rate;
		cin >> name >> rarity >> rate;
		ratesum += rate;
		if(name.find("Alicia") != string::npos && rarity != 'N')
			aliciasum += rate;
	}
	printf("%.10f\n", (double)((long double)aliciasum / ratesum * T));
	return 0;
}

Submission Info

Submission Time
Task E - Alicia's Rare card Challenge
User anta
Language C++ (G++ 4.6.4)
Score 100
Code Size 1606 Byte
Status AC
Exec Time 40 ms
Memory 920 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 21
Set Name Test Cases
All 00-sample, 50-random-00, 50-random-01, 50-random-02, 50-random-03, 50-random-04, 50-random-05, 50-random-06, 50-random-07, 50-random-08, 50-random-09, 50-random-10, 50-random-11, 50-random-12, 50-random-13, 50-random-14, 50-random-15, 50-random-16, 50-random-17, 50-random-18, 50-random-19
Case Name Status Exec Time Memory
00-sample AC 21 ms 912 KB
50-random-00 AC 39 ms 804 KB
50-random-01 AC 35 ms 788 KB
50-random-02 AC 37 ms 796 KB
50-random-03 AC 37 ms 812 KB
50-random-04 AC 31 ms 808 KB
50-random-05 AC 33 ms 808 KB
50-random-06 AC 26 ms 792 KB
50-random-07 AC 33 ms 808 KB
50-random-08 AC 25 ms 808 KB
50-random-09 AC 25 ms 916 KB
50-random-10 AC 30 ms 812 KB
50-random-11 AC 38 ms 812 KB
50-random-12 AC 23 ms 808 KB
50-random-13 AC 30 ms 796 KB
50-random-14 AC 40 ms 804 KB
50-random-15 AC 40 ms 792 KB
50-random-16 AC 23 ms 804 KB
50-random-17 AC 25 ms 808 KB
50-random-18 AC 26 ms 920 KB
50-random-19 AC 34 ms 808 KB