結果

問題 No.405 ローマ数字の腕時計
ユーザー mmn15277198mmn15277198
提出日時 2020-06-07 14:00:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 633 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 95,420 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 00:45:30
合計ジャッジ時間 1,953 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:36:11: 警告: ‘id’ may be used uninitialized [-Wmaybe-uninitialized]
   36 |         id+=t;
      |         ~~^~~
main.cpp:29:13: 備考: ‘id’ はここで定義されています
   29 |         int id;
      |             ^~

ソースコード

diff #

#include<iostream>
#include<math.h>
#include<string.h>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<deque>
#include<map>
#include<stdio.h>
using namespace std;

int main(){
	string s1;
	int t;
	cin >> s1 >> t;
	vector<string> s;
	s.push_back("I");
	s.push_back("II");
	s.push_back("III");
	s.push_back("IIII");
	s.push_back("V");
	s.push_back("VI");
	s.push_back("VII");
	s.push_back("VIII");
	s.push_back("IX");
	s.push_back("X");
	s.push_back("XI");
	s.push_back("XII");
	int id;
	for(int i=0;i<s.size();i++){
		if(s[i]==s1)id=i;
	}
	while(t<0){
		t+=12;
	}
	id+=t;
	id%=12;
	cout << s[id] << endl;
	return 0;
}
0