結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-07-28 21:22:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 335 bytes |
| コンパイル時間 | 1,438 ms |
| コンパイル使用メモリ | 170,616 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 19:29:40 |
| 合計ジャッジ時間 | 2,203 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:14:10: warning: 'x' may be used uninitialized [-Wmaybe-uninitialized]
14 | x = (x + T % 12 + 12) % 12;
| ~~^~~~~~~~
main.cpp:8:7: note: 'x' was declared here
8 | int x;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
vector<string> S = {"I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"};
int main(){
string S1;
int T;
cin >> S1 >> T;
int x;
for (int i = 0; i < 12; i++){
if (S[i] == S1){
x = i;
}
}
x = (x + T % 12 + 12) % 12;
cout << S[x] << endl;
}
SSRS