結果

問題 No.2835 Take and Flip
コンテスト
ユーザー true
提出日時 2026-07-13 03:09:30
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 68 ms / 2,000 ms
+ 841µs
コード長 3,722 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,227 ms
コンパイル使用メモリ 171,792 KB
実行使用メモリ 199,272 KB
最終ジャッジ日時 2026-07-13 03:09:47
合計ジャッジ時間 9,052 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (88 ミリ秒)。
  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.Text;using System.Numerics;using System.Runtime.CompilerServices;using System;using System.Collections.Generic;using System.Linq;using System.IO;using System.Security.Cryptography;using System.Buffers;using System.Diagnostics;
#nullable enable


var fs = new FastScanner();
var sb = new StringBuilder();




int N=fs.Int();
long sum=0;
while(N-->0) sum+=fs.Long();
sb.Append(sum);

















































Console.Write(sb.ToString());
Console.Out.Flush();
Environment.Exit(0);

class FastScanner
{
  private readonly Stream stream = Console.OpenStandardInput();
  private readonly byte[] buffer = new byte[1 << 16];
  private int ptr = 0, len = 0;

  private byte Read()
  {
    if (ptr >= len)
    {
      len = stream.Read(buffer, 0, buffer.Length);
      ptr = 0;
      if (len == 0) return 0;
    }
    return buffer[ptr++];
  }

  public int Int()
  {
    int c;
    while ((c = Read()) <= ' ') if (c == 0) return 0;
    int sign = 1;
    if (c == '-')
    {
      sign = -1;
      c = Read();
    }
    int val = c - '0';
    while ((c = Read()) >= '0')
    {
      checked
      {
        val = val * 10 + c - '0';
      }
    }
    return val * sign;
  }

  public (int, int) Int2()
    => (Int(), Int());

  public (int, int, int) Int3()
    => (Int(), Int(), Int());

  public (int, int, int, int) Int4()
    => (Int(), Int(), Int(), Int());

  public long Long()
  {
    int c;
    while ((c = Read()) <= ' ') if (c == 0) return 0;
    int sign = 1;
    if (c == '-')
    {
      sign = -1;
      c = Read();
    }
    long val = c - '0';
    while ((c = Read()) >= '0')
      val = val * 10 + c - '0';
    return val * sign;
  }

  public (long, long) Long2()
    => (Long(), Long());

  public (long, long, long) Long3()
    => (Long(), Long(), Long());

  public (long, long, long, long) Long4()
    => (Long(), Long(), Long(), Long());

  public (int, long) IntLong()
    => (Int(), Long());

  public int[] Digits()
  {
    var s = this.String();
    var res = new int[s.Length];
    for (int i = 0; i < s.Length; ++i) res[i] = s[i] - '0';
    return res;
  }

  public string String()
  {
    int c;
    while ((c = Read()) <= ' ') if (c == 0) return "";
    var sb = new StringBuilder();
    do
    {
      sb.Append((char)c);
      c = Read();
    } while (c > ' ');
    return sb.ToString();
  }
  public (string, string) String2()
    => (String(), String());
  public (string, string, string) String3()
    => (String(), String(), String());

  public double Double()
  {
    int c;
    while ((c = Read()) <= ' ') if (c == 0) return 0;

    int sign = 1;
    if (c == '-')
    {
      sign = -1;
      c = Read();
    }

    double val = 0;

    // integer part
    while (c >= '0' && c <= '9')
    {
      val = val * 10 + (c - '0');
      c = Read();
    }

    // fractional part
    if (c == '.')
    {
      double scale = 1;
      while ((c = Read()) >= '0' && c <= '9')
      {
        scale *= 0.1;
        val += (c - '0') * scale;
      }
    }

    // exponent part
    if (c == 'e' || c == 'E')
    {
      int esign = 1;
      int exp = 0;

      c = Read();
      if (c == '-')
      {
        esign = -1;
        c = Read();
      }
      else if (c == '+')
      {
        c = Read();
      }

      while (c >= '0' && c <= '9')
      {
        exp = exp * 10 + (c - '0');
        c = Read();
      }

      val *= Math.Pow(10, esign * exp);
    }

    return val * sign;
  }

  public (double, double) Double2()
    => (Double(), Double());
  public (double, double, double) Double3()
    => (Double(), Double(), Double());

  public char Char()
  {
    int c;
    while ((c = Read()) <= ' ') if (c == 0) return '\0';
    return (char)c;
  }
}
0