結果

問題 No.607 開通777年記念
ユーザー NoNo
提出日時 2018-01-26 18:39:00
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,027 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 104,220 KB
実行使用メモリ 48,616 KB
最終ジャッジ日時 2023-08-27 18:39:40
合計ジャッジ時間 4,384 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 58 ms
21,772 KB
testcase_02 WA -
testcase_03 AC 58 ms
21,780 KB
testcase_04 AC 58 ms
21,852 KB
testcase_05 AC 58 ms
21,792 KB
testcase_06 AC 58 ms
21,652 KB
testcase_07 AC 116 ms
23,792 KB
testcase_08 AC 59 ms
23,700 KB
testcase_09 AC 62 ms
21,728 KB
testcase_10 AC 61 ms
21,652 KB
testcase_11 AC 366 ms
48,616 KB
testcase_12 AC 352 ms
42,240 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int m = int.Parse(ss[1]);
            int[] a = new int[n];
            bool f = false;

            for (int i = 0; i < m; i++)
            {
                int[] b = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
                for (int j = 0; j < n; j++)
                {
                    a[j] += b[j];
                }

                for (int j = 0; j < n; j++)
                {
                    if (a[j] == 777)
                    {
                        f = true;
                    }
                    if (j != n - 1 && a[j] + a[j + 1] == 777)
                    {
                        f = true;
                    }
                }
            }
            if (f) Console.WriteLine("YES");
            else Console.WriteLine("NO");
        }
    }
}
0