結果

問題 No.437 cwwゲーム
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-10-28 23:03:31
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,003 bytes
コンパイル時間 1,663 ms
コンパイル使用メモリ 145,756 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-15 21:29:02
合計ジャッジ時間 5,416 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,112 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 197 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;

int main(void){
	string s; cin >> s;
	int k = s.size();
	int ret = 0;
	//5進数bit全探索
	for (int mask = 0; mask < pow(4, k); ++mask){
		int ans = 0;

		int tmask = mask;
		int bit[15];
		rep(pos, k){
			bit[pos] = tmask % 4;
			tmask /= 4;
		}
		rep(i, 4){
			string tm = "";
			rep(j, k){
				if(bit[j] == i) tm += s[j];
			}
			
			if(tm.size() == 3){
				if(tm[0] != '0' && tm[1] == tm[2] && tm[0] != tm[1]){
					ans += stoi(tm);
				}
			}
		}
		chmax(ret, ans);
	}
	printf("%d\n", ret);
	return 0;
}
0