結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
|
提出日時 | 2017-10-27 06:09:25 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 1,353 bytes |
コンパイル時間 | 831 ms |
コンパイル使用メモリ | 105,472 KB |
実行使用メモリ | 18,176 KB |
最終ジャッジ日時 | 2024-07-06 19:14:37 |
合計ジャッジ時間 | 2,327 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace yukicodeX { public class Program { public static string Solver(System.IO.TextReader reader) { var t = new string[] { "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" }; var s = reader.ReadLine().Split(); var now = Array.IndexOf( t, s[ 0 ] ) + 1; var answer = ( now + int.Parse( s[ 1 ] ) % 12 ) % 12; return t[ answer>0?answer - 1:answer+12-1 ]; } private static void Main() { Console.WriteLine( Solver( Console.In ) ); } } public class MyLib { public static string Ordinalization(int num) { string surfix = "stndrdth"; return string.Format( "{0}{1}", num, ( 0 < num % 10 && num % 10 <= 4 ) && ( ( num % 100 ) / 10 != 1 ) ? surfix.Substring( ( num % 10 - 1 ) * 2, 2 ) : surfix.Substring( 6 ) ); } public static List<int> GetIntList(string input, char delimitor) { return input.Split( delimitor ).ToList<string>().ConvertAll<int>( int.Parse ); } public static List<int> GetIntList(string input, char[] delimitors) { return input.Split( delimitors ).ToList<string>().ConvertAll<int>( int.Parse ); } } }