結果

問題 No.423 ハムスター語初級(数詞)
ユーザー Lay_ecLay_ec
提出日時 2016-09-22 22:27:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 709 ms
コンパイル使用メモリ 83,640 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 18:46:23
合計ジャッジ時間 1,210 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>

using namespace std;

int main()
{
    
	string s;
	cin>>s;

	long long x=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='m'){
			if(i+1<s.size() && s[i+1]=='u') x*=2LL,x++;
			else x*=2LL;
		}
	}
	
	x*=2;

	vector<string> vs;
	while(x){
		if(x%2) vs.push_back("hamu");
		else vs.push_back("ham");
		x/=2;
	}

	for(int i=vs.size()-1;i>=0;i--) cout<<vs[i];
	cout<<endl;

	
    
    return 0;
}
0