結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-31 01:16:53 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 882 bytes |
| コンパイル時間 | 1,254 ms |
| コンパイル使用メモリ | 107,136 KB |
| 実行使用メモリ | 19,200 KB |
| 最終ジャッジ日時 | 2024-12-29 21:57:45 |
| 合計ジャッジ時間 | 3,018 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
namespace y
{
class Program
{
static void Main(string[] args)
{
var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
int cnt = 0;
if ((a[0] < a[1] && a[1] > a[2] && a[0] != a[2]) || (a[0] > a[1] && a[1] < a[2] && a[0] != a[2]))
{
Console.WriteLine("INF");
}
else
{
for (int i = 2; i < 1000; i++)
{
int b1 = a[0] % i;
int b2 = a[1] % i;
int b3 = a[2] % i;
if ((b1 < b2 && b2 > b3 && b1 != b3) || (b1 > b2 && b2 < b3 && b1 != b3))
{
cnt++;
}
}
Console.WriteLine(cnt);
}
}
}
}
No