結果
問題 | No.26 シャッフルゲーム |
ユーザー | fujita |
提出日時 | 2023-04-28 15:25:45 |
言語 | C# (.NET 8.0.203) |
結果 |
AC
|
実行時間 | 69 ms / 5,000 ms |
コード長 | 1,083 bytes |
コンパイル時間 | 13,504 ms |
コンパイル使用メモリ | 166,920 KB |
実行使用メモリ | 184,404 KB |
最終ジャッジ日時 | 2024-04-28 20:04:53 |
合計ジャッジ時間 | 14,797 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 68 ms
31,232 KB |
testcase_01 | AC | 68 ms
31,104 KB |
testcase_02 | AC | 69 ms
31,364 KB |
testcase_03 | AC | 68 ms
31,492 KB |
testcase_04 | AC | 68 ms
31,360 KB |
testcase_05 | AC | 67 ms
31,376 KB |
testcase_06 | AC | 67 ms
31,372 KB |
testcase_07 | AC | 67 ms
31,244 KB |
testcase_08 | AC | 68 ms
31,232 KB |
testcase_09 | AC | 68 ms
184,404 KB |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (100 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System.Collections.Generic; using System; using System.Linq; using System.Drawing; namespace yukicoder { class Program { static void Main(string[] args) { var N = int.Parse(Console.ReadLine()); var M = int.Parse(Console.ReadLine()); int M1, M2 ; string sss = ""; string[] strings = new string[] {"1" , "2" , "3"}; for (int i = 0; i < M; i++) { var O = Console.ReadLine().Split(" "); M1 = int.Parse(O[0]); M2 = int.Parse(O[1]); var temp = strings[M1 - 1]; strings[M1 - 1] = strings[M2 - 1]; strings[M2 - 1] = temp; } string str = N.ToString(); for(int c = 0; c < strings.Length; c++) { sss += strings[c]; } int ans = sss.IndexOf(str); Console.WriteLine(ans + 1); } } }