結果

問題 No.405 ローマ数字の腕時計
ユーザー kyawashellkyawashell
提出日時 2017-12-08 17:45:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 890 bytes
コンパイル時間 929 ms
コンパイル使用メモリ 103,304 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 19:15:00
合計ジャッジ時間 1,605 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:31:14: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |              ^~~
main.cpp:31:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                  ^~~~
main.cpp:31:23: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                       ^~~~~
main.cpp:31:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                             ^~~~~~
main.cpp:31:36: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                                    ^~~
main.cpp:31:40: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                                        ^~~~
main.cpp:31:45: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                                             ^~~~~
main.cpp:31:51: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
      |                                                   ^~~~~~
main.cpp:31:58: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   31 | char *s[] = {"I","II","III","IIII","V","VI","VII"

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<complex>

typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second

char *s[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};

int main(){

	char s1[1000];
	int t;
	scanf("%s%d",s1,&t);

	REP(i,12){
		if(strcmp(s[i],s1) == 0){
			printf("%s\n",s[(i + t + 1200) % 12]);
		}
	}
	return 0;
}

0