結果

問題 No.3677 Global Checksum
コンテスト
ユーザー 👑 みうね
提出日時 2026-08-10 05:49:47
言語 C#
(.NET 10.0.400)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
TLE  
実行時間 -
コード長 1,767 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,623 ms
コンパイル使用メモリ 172,144 KB
実行使用メモリ 73,088 KB
最終ジャッジ日時 2026-09-04 22:15:14
合計ジャッジ時間 12,655 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 TLE * 1 -- * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (86 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

using System;
using System.IO;

class Solution {
    static byte[] input = new byte[40000032];
    static int inputLength;
    static int position;

    static uint NextUInt() {
        int c;
        do c = input[position++]; while (c <= 32);
        uint value = 0;
        while (c >= '0' && c <= '9') {
            value = unchecked(value * 10u + (uint)(c - '0'));
            c = input[position++];
        }
        return value;
    }

    static void Main() {
        using (Stream stream = Console.OpenStandardInput()) {
            while (inputLength < input.Length) {
                int count = stream.Read(input, inputLength, input.Length - inputLength);
                if (count == 0) break;
                inputLength += count;
            }
        }

        int h = (int)NextUInt();
        int w = (int)NextUInt();
        uint[] rowSum = new uint[h];
        uint total = 0;
        for (int i = 0; i < h; ++i) {
            uint sum = 0;
            for (int j = 0; j < w; ++j) sum = unchecked(sum + NextUInt());
            rowSum[i] = sum;
            total = unchecked(total + sum);
        }

        byte[] output = new byte[h * 11];
        byte[] reversed = new byte[10];
        int outputPosition = 0;
        foreach (uint sum in rowSum) {
            uint value = unchecked(sum + total);
            int length = 0;
            do {
                reversed[length++] = (byte)('0' + value % 10);
                value /= 10;
            } while (value != 0);
            while (length != 0) output[outputPosition++] = reversed[--length];
            output[outputPosition++] = (byte)'\n';
        }
        using (Stream stream = Console.OpenStandardOutput()) {
            stream.Write(output, 0, outputPosition);
        }
    }
}
0