結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
14番
|
| 提出日時 | 2016-07-17 12:24:21 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 1,000 ms |
| コード長 | 1,760 bytes |
| コンパイル時間 | 2,253 ms |
| コンパイル使用メモリ | 107,392 KB |
| 実行使用メモリ | 19,072 KB |
| 最終ジャッジ日時 | 2024-10-15 15:19:17 |
| 合計ジャッジ時間 | 4,091 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
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.Text;
using System.Linq;
class Program
{
public void Proc()
{
Reader.IsDebug = false;
int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray();
if(IsKadomatsu(inpt[0], inpt[1], inpt[2])) {
Console.WriteLine("INF");
return;
}
if(inpt[0] == inpt[1] || inpt[0] == inpt[2] || inpt[1] == inpt[2]) {
Console.WriteLine("0");
return;
}
long ans = 0;
for(int i=2; i<=inpt.Max(a=>a); i++) {
if(this.IsKadomatsu(inpt[0] % i, inpt[1] % i, inpt[2] % i)) {
ans++;
}
}
Console.WriteLine(ans);
}
private bool IsKadomatsu(int numA, int numB, int numC) {
if(numA == numB || numA == numC || numB == numC) {
return false;
}
if(numA < numB && numC < numB) {
return true;
}
if(numA > numB && numC > numB) {
return true;
}
return false;
}
public class Reader
{
public static bool IsDebug = true;
private static String PlainInput = @"
114 514 114
";
private static System.IO.StringReader Sr = null;
public static string ReadLine()
{
if (IsDebug)
{
if (Sr == null)
{
Sr = new System.IO.StringReader(PlainInput.Trim());
}
return Sr.ReadLine();
}
else
{
return Console.ReadLine();
}
}
}
static void Main()
{
Program prg = new Program();
prg.Proc();
}
}
14番