結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-05 13:37:17 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 331 bytes |
| 記録 | |
| コンパイル時間 | 1,015 ms |
| コンパイル使用メモリ | 178,212 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-29 23:55:58 |
| 合計ジャッジ時間 | 2,142 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 23 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:15:14: warning: 's_num' may be used uninitialized [-Wmaybe-uninitialized]
15 | cout<<a[(t+s_num-1 + 1200)% 12]<<endl;
| ~^~~~~~
main.cpp:6:9: note: 's_num' was declared here
6 | int t,s_num;
| ^~~~~
ソースコード
#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;
}