Submission #26778810


Source Code Expand

using System;
using System.Text;

namespace Name1
{
    class test
    {
        static void Main(string[] args)
        {
            var HW = Console.ReadLine().Split(' ');
            var H = Convert.ToInt32(HW[0]);
            var W = Convert.ToInt32(HW[1]);
            var A = new long[H, W];
            for (int i = 0; i < H; i++)
            {
                var line = Console.ReadLine().Split(' ');
                for (int j = 0; j < W; j++)
                {
                    A[i, j] = Convert.ToInt64(line[j]);
                }
            }
            bool found = true;
            for (int i1 = 0; i1 < H - 1 && found; i1++)
            {
                for (int i2 = i1 + 1; i2 < H && found; i2++)
                {
                    for (int j1 = 0; j1 < W - 1 && found; j1++)
                    {
                        for (int j2 = j1 + 1; j2 < W && found; j2++)
                        {
                            var left = A[i1, j1] + A[i2, j2];
                            var right = A[i2, j1] + A[i1, j2];
                            if (left > right)
                            {
                                found = false;
                                break;
                            }                            
                        }
                    }
                }
            }
            if (found)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }
    }
}

Submission Info

Submission Time
Task B - Mongeness
User umagemarc
Language C# (.NET Core 3.1.201)
Score 200
Code Size 1536 Byte
Status AC
Exec Time 105 ms
Memory 27632 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 30
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 81 ms 27056 KiB
001.txt AC 87 ms 27488 KiB
002.txt AC 86 ms 27248 KiB
003.txt AC 77 ms 27248 KiB
004.txt AC 105 ms 27404 KiB
005.txt AC 90 ms 27548 KiB
006.txt AC 84 ms 27324 KiB
007.txt AC 87 ms 27212 KiB
008.txt AC 80 ms 27300 KiB
009.txt AC 94 ms 27296 KiB
010.txt AC 103 ms 27464 KiB
011.txt AC 94 ms 27132 KiB
012.txt AC 80 ms 27092 KiB
013.txt AC 83 ms 26916 KiB
014.txt AC 86 ms 26944 KiB
015.txt AC 82 ms 27004 KiB
016.txt AC 80 ms 27632 KiB
017.txt AC 80 ms 27160 KiB
018.txt AC 72 ms 27112 KiB
019.txt AC 78 ms 26912 KiB
020.txt AC 79 ms 27148 KiB
021.txt AC 81 ms 27072 KiB
022.txt AC 84 ms 27444 KiB
023.txt AC 77 ms 27580 KiB
024.txt AC 80 ms 27028 KiB
025.txt AC 88 ms 26916 KiB
026.txt AC 84 ms 27588 KiB
027.txt AC 87 ms 27324 KiB
example0.txt AC 88 ms 26884 KiB
example1.txt AC 79 ms 27404 KiB