結果

問題 No.682 Average
ユーザー uma-pinehill
提出日時 2018-05-17 14:56:17
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 109,448 KB
実行使用メモリ 26,260 KB
最終ジャッジ日時 2024-06-28 13:30:11
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program
{
    static void Main()
    {
        string s = Console.ReadLine();
        string[] t = s.Split(' ');
        int a = int.Parse(t[0]);
        int b = int.Parse(t[1]);
        int dif = b - a + 1;
        int result = (dif / 3)|0 + ((((a + b) % 3 == 0)||((a + b)%3 + dif % 3)>=3) ? 1 : 0);
        Console.WriteLine(result);
    }
}
0