結果

問題 No.405 ローマ数字の腕時計
ユーザー kyawashell
提出日時 2017-12-08 17:44:14
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 890 bytes
コンパイル時間 1,002 ms
コンパイル使用メモリ 101,812 KB
最終ジャッジ日時 2025-01-05 04:59:54
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[] = {

ソースコード

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 + 2000) % 12]);
		}
	}
	return 0;
}

0