結果
問題 | No.1665 quotient replace |
ユーザー |
|
提出日時 | 2021-09-03 22:39:03 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,954 bytes |
コンパイル時間 | 1,455 ms |
コンパイル使用メモリ | 103,808 KB |
実行使用メモリ | 107,968 KB |
最終ジャッジ日時 | 2024-12-15 15:28:15 |
合計ジャッジ時間 | 121,313 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 13 TLE * 28 |
コンパイルメッセージ
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.Text;using System.Text.RegularExpressions;using System.Threading;namespace yukicoder_contest_312{class _3{static void Main (string[] args){int n = int.Parse(Console.ReadLine());string[] inA = Regex.Split(Console.ReadLine(), "[ ]");int[] a = new int[n];for (int i = 0; i <= n - 1; i++) a[i] = int.Parse(inA[i]);int turn = 0;string output;while(true){a[turn] = process(a[turn]);Console.WriteLine(a[turn]);//Thread.Sleep(1000);int judge = a[0];foreach (int i in a){if (i > judge) judge = i;}if (judge == 1){if (turn % 2 == 0){output = "white";break;}else{output = "black";break;}}else{if (turn == a.Length - 1) turn = 0;else turn++;}}Console.WriteLine(output);}static int process (int num){int output = 1;for (int i = 2; i <= num; i++){if (num % i == 0){if ((num / i) % 2 != 0){if (output < num / i){output = num / i;}}}}return output;}}}