結果

問題 No.662 スロットマシーン
ユーザー kotatsugamekotatsugame
提出日時 2018-06-15 02:44:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 705 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 85,156 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-09-13 04:29:41
合計ジャッジ時間 4,875 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,756 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 7 ms
4,376 KB
testcase_03 AC 247 ms
4,380 KB
testcase_04 AC 82 ms
4,376 KB
testcase_05 AC 20 ms
4,376 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<map>
#include<iomanip>
using namespace std;
string s[5],t[3][5000];
int c[5],n[3],cnt[5];
map<string,int>M;
main()
{
	for(int i=0;i<5;i++)
	{
		cin>>s[i]>>c[i];
		M[s[i]]=i;
	}
	for(int i=0;i<3;i++)
	{
		cin>>n[i];
		for(int j=0;j<n[i];j++)cin>>t[i][j];
	}
	for(int i=0;i<n[0];i++)
		for(int j=0;j<n[1];j++)
			for(int k=0;k<n[2];k++)
			{
				if(t[0][i]==t[1][j]&&t[0][i]==t[2][k])
				{
					cnt[M[t[0][i]]]+=3;
				}
				if(t[0][i]==t[1][(j+1)%n[1]]&&t[0][i]==t[2][(k+2)%n[2]])
				{
					cnt[M[t[0][i]]]+=2;
				}
			}
	double ans=0;
	for(int i=0;i<5;i++)ans+=cnt[i]*c[i];
	cout<<fixed<<setprecision(9)<<ans/n[0]/n[1]/n[2]<<endl;
	for(int i=0;i<5;i++)cout<<cnt[i]<<endl;
}
0