結果

問題 No.405 ローマ数字の腕時計
ユーザー ミドリムシ
提出日時 2017-10-14 00:09:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 691 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 59,512 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-17 11:53:59
合計ジャッジ時間 1,373 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
	string S;
	int T;
	cin >> S >> T;
	int now_time = 0;
	if(S == "IX"){
		now_time = 9;
	}else{
		for(int i = 0; i < S.size(); i++){
			if(S[i] == 'X'){
				now_time += 10;
			}else if(S[i] == 'V'){
				now_time += 5;
			}else{
				now_time++;
			}
		}
	}
	now_time = (now_time + T + 1199) % 12 + 1;
	if(now_time == 9){
		cout << "IX" << endl;
	}else{
		for(int i = 0; i < now_time / 10; i++){
			cout << "X" << endl;
		}
		now_time -= now_time / 10;
		for(int i = 0; i < now_time / 5; i++){
			cout << "V" << endl;
		}
		now_time -= now_time / 5;
		for(int i = 0; i < now_time; i++){
			cout << "I" << endl;
		}
	}
}
0