結果
問題 |
No.1021 Children in Classrooms
|
ユーザー |
![]() |
提出日時 | 2023-05-30 13:33:14 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 708 bytes |
コンパイル時間 | 4,184 ms |
コンパイル使用メモリ | 107,264 KB |
実行使用メモリ | 55,552 KB |
最終ジャッジ日時 | 2024-12-28 11:48:14 |
合計ジャッジ時間 | 36,731 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 TLE * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; using System.Collections.Generic; namespace yukicoder { class pg { static void Main(string[] args) { var line = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToList(); int N = line[0]; int M = line[1]; var nums = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToList(); string S = Console.ReadLine(); for(int i = 0;i < M;i++) { if(S[i] == 'R') { nums[N - 2] += nums[N - 1]; nums.RemoveAt(N - 1); nums.Insert(0,0); }else { nums[1] += nums[0]; nums.RemoveAt(0); nums.Insert(N - 1,0); } } foreach(int i in nums) { Console.Write(i + " "); } } } }