結果
問題 | No.358 も~っと!門松列 |
ユーザー |
![]() |
提出日時 | 2018-01-31 01:17:35 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 30 ms / 1,000 ms |
コード長 | 883 bytes |
コンパイル時間 | 3,579 ms |
コンパイル使用メモリ | 113,220 KB |
実行使用メモリ | 19,200 KB |
最終ジャッジ日時 | 2024-12-29 21:59:25 |
合計ジャッジ時間 | 5,075 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.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);}}}}