結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-27 21:50:47 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 1,000 ms |
| コード長 | 670 bytes |
| コンパイル時間 | 4,808 ms |
| コンパイル使用メモリ | 103,168 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-12-29 07:06:29 |
| 合計ジャッジ時間 | 2,680 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace y
{
class Program
{
static void Main(string[] args)
{
var ss = Console.ReadLine().Split();
int n = int.Parse(ss[0]);
int m = int.Parse(ss[1]);
ss = Console.ReadLine().Split();
int x = int.Parse(ss[0]);
int y = int.Parse(ss[1]);
Console.WriteLine(U(x, m) == U(y, m) ? "YES" : "NO");
}
static int U(int a, int m)
{
int c = 0;
if ((Math.Ceiling((double)a / m) % 2) == 1)c = a % m == 0 ? m : a % m;
else c = a % m == 0 ? 1 : m - a % m + 1;
return c;
}
}
}
No