結果
| 問題 |
No.485 方程式のお勉強
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-25 01:14:28 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 1,205 bytes |
| コンパイル時間 | 3,285 ms |
| コンパイル使用メモリ | 105,216 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-11-21 17:58:53 |
| 合計ジャッジ時間 | 2,109 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
コンパイルメッセージ
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 yukicode {
public class Program {
public static string Solver(System.IO.TextReader reader) {
var k = MyLib.GetIntList( reader.ReadLine(), ' ' );
int r;
var q = Math.DivRem( k[ 1 ], k[ 0 ], out r );
return r == 0 ? q.ToString() : "NO";
}
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 );
}
}
}