結果

問題 No.785 色食い虫
ユーザー forest3
提出日時 2020-04-01 16:33:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 1,365 ms
コンパイル使用メモリ 168,012 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 23:40:03
合計ジャッジ時間 2,464 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	string s[3];
	cin >> s[0] >> s[1] >> s[2];

	int num[3] = {0};
	for( int i = 0; i < 3; i++ ) {
		if( s[i] == "NONE" ) num[i] = 16;
		else {
			int n = 1;
			int pos = 0;
			while( true ) {
				int j = s[i].find( ',', pos );
				if( j == string::npos ) break;
				n++;
				pos = j + 1;
			}
			num[i] = 16 - n;
		}
	}

	int ans = num[0] * num[0] * num[1] * num[1] * num[2] * num[2];

	cout << ans << endl;
}
0