結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-05 13:37:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 331 bytes |
| 記録 | |
| コンパイル時間 | 1,340 ms |
| コンパイル使用メモリ | 160,888 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-24 04:17:22 |
| 合計ジャッジ時間 | 2,370 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:15:14: warning: ‘s_num’ may be used uninitialized in this function [-Wmaybe-uninitialized]
15 | cout<<a[(t+s_num-1 + 1200)% 12]<<endl;
| ~^~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int t,s_num;
string a[]={"I","II","III","IIII","IV","V","VI","VII","VIII","IX","X","XI","XII"};
cin>>s>>t;
//cout<<s<<endl;
for(int i=0;i<12;i++){
if(a[i]==s){
s_num=i;
}
}
cout<<a[(t+s_num-1 + 1200)% 12]<<endl;
return 0;
}