結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-06-07 14:00:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 633 bytes |
| コンパイル時間 | 949 ms |
| コンパイル使用メモリ | 96,784 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 19:28:28 |
| 合計ジャッジ時間 | 1,783 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:36:11: warning: 'id' may be used uninitialized [-Wmaybe-uninitialized]
36 | id+=t;
| ~~^~~
main.cpp:29:13: note: 'id' was declared here
29 | int id;
| ^~
ソースコード
#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;
}
mmn15277198