結果
問題 |
No.8 N言っちゃダメゲーム
|
ユーザー |
|
提出日時 | 2022-05-17 17:56:00 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 56 ms / 5,000 ms |
コード長 | 854 bytes |
コンパイル時間 | 3,547 ms |
コンパイル使用メモリ | 75,680 KB |
実行使用メモリ | 37,172 KB |
最終ジャッジ日時 | 2024-09-15 12:48:16 |
合計ジャッジ時間 | 5,033 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class No8 { public static void main(String[] args) throws IOException{ //N言っちゃダメゲーム String[] text = readStr(); int P = Integer.parseInt(text[0]) , N , K; for(int i = 0;i < P;i++) { N = Integer.parseInt(text[i+1].split(" ")[0]); K = Integer.parseInt(text[i+1].split(" ")[1]); System.out.println((N - 1) % (K + 1) != 0 ? "Win" : "Lose"); } } public static String[] readStr() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList<String> list = new ArrayList<>(); do { list.add(br.readLine()); }while(br.ready()); br.close(); String[] text = new String[list.size()]; list.toArray(text); return text; } }