結果

問題 No.405 ローマ数字の腕時計
ユーザー d_seid_sei
提出日時 2019-08-25 09:35:34
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 436 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 79,200 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 19:01:05
合計ジャッジ時間 2,850 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 RE -
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 1 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 1 ms
6,940 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:22:26: warning: 'IA' may be used uninitialized [-Wmaybe-uninitialized]
   22 |                 IB = (IA + T) % 12;
      |                      ~~~~^~~~
main.cpp:14:13: note: 'IA' was declared here
   14 |         int IA;
      |             ^~

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
using namespace std;
typedef long long int lont;
int main() {
	string S;
	int T;
	cin >> S;
	cin >> T;
	vector<string>vec(12);
	vec = { "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII" };
	int IA;
	int IB;
	for (int ia = 0; ia < 12; ia++) {
		if (vec.at(ia) == S) {
			IA = ia;
			break;
		}
	}
		IB = (IA + T) % 12;
		cout << vec.at(IB) << endl;
}
0