結果
問題 | No.1942 Leading zero |
ユーザー | marimom7 |
提出日時 | 2022-06-30 02:27:41 |
言語 | C# (.NET 8.0.203) |
結果 |
AC
|
実行時間 | 543 ms / 2,000 ms |
コード長 | 890 bytes |
コンパイル時間 | 7,222 ms |
コンパイル使用メモリ | 145,904 KB |
実行使用メモリ | 193,740 KB |
最終ジャッジ日時 | 2023-08-15 11:22:02 |
合計ジャッジ時間 | 8,455 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 49 ms
30,152 KB |
testcase_01 | AC | 47 ms
27,936 KB |
testcase_02 | AC | 543 ms
193,740 KB |
コンパイルメッセージ
Determining projects to restore... Restored /home/judge/data/code/main.csproj (in 127 ms). .NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f Copyright (C) Microsoft Corporation.All rights reserved. プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください main -> /home/judge/data/code/bin/Release/net6.0/main.dll main -> /home/judge/data/code/bin/Release/net6.0/publish/
ソースコード
using System; public class Program { static void Main() { // データ初期化 string outputString = ""; // 初期データ入力 string line = System.Console.ReadLine(); // 処理開始 string readString = ""; bool checkZero = false; for(int i = 0; i < int.Parse(line); i++) { readString = System.Console.ReadLine(); checkZero = true; for(int stcount = 0; stcount < readString.Length; stcount++) { // ゼロが終わるまで空回し if(checkZero) checkZero = readString[stcount] == '0'; if(checkZero) continue; // 空回しが終わったらデータ作成 outputString += readString[stcount]; } // 全てが0なら一文字追加する if(checkZero) outputString += "0"; outputString += "\n"; } outputString.Remove(outputString.Length - 1); Console.Write(outputString); } }