結果
問題 | No.2401 Dirty Shoes and Stairs |
ユーザー |
|
提出日時 | 2023-08-06 20:53:10 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 110 ms / 2,000 ms |
コード長 | 828 bytes |
コンパイル時間 | 2,878 ms |
コンパイル使用メモリ | 107,136 KB |
実行使用メモリ | 38,016 KB |
最終ジャッジ日時 | 2024-11-06 23:59:33 |
合計ジャッジ時間 | 4,986 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int M1 = int.Parse(Console.ReadLine()); var A = ReadInts(); int M2 = int.Parse(Console.ReadLine()); var B = ReadInts(); var C = new int[N + 1].ToList(); int p = 0; foreach(var a in A) { p += a; C[p] = 1; } foreach(var b in B) { p -= b; C[p] = 1; } Console.WriteLine(N+1-C.Sum()); } static List<int> ReadInts() { var strs = new List<string>(Console.ReadLine().Split(' ')); return strs.ConvertAll(x => int.Parse(x)); } }