結果

問題 No.405 ローマ数字の腕時計
ユーザー Mayimg
提出日時 2018-12-26 08:09:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 1,515 ms
コンパイル使用メモリ 169,484 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 19:21:08
合計ジャッジ時間 2,336 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:16:13: warning: 'tim' may be used uninitialized [-Wmaybe-uninitialized]
   16 |         tim += t + 1200;
      |         ~~~~^~~~~~~~~~~
main.cpp:10:13: note: 'tim' was declared here
   10 |         int tim;
      |             ^~~

ソースコード

diff #

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);  
	string c[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
	string s;
	cin >> s;
	int tim;
	for(int i = 0; i < 12; i++) {
		if(s == c[i]) tim = i;
	}
	int t;
	cin >> t;
	tim += t + 1200;
	cout << c[tim % 12] << '\n';
	return 0;	
}
0