結果
問題 |
No.3036 Nauclhlt型文字列
|
ユーザー |
![]() |
提出日時 | 2025-03-22 14:17:06 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 266 ms / 2,000 ms |
コード長 | 675 bytes |
コンパイル時間 | 3,747 ms |
コンパイル使用メモリ | 77,504 KB |
実行使用メモリ | 58,968 KB |
最終ジャッジ日時 | 2025-03-22 14:17:15 |
合計ジャッジ時間 | 7,774 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
import java.util.Scanner; public class No3036 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int strNum = Integer.parseInt(sc.nextLine()); String inputStr = sc.nextLine(); if(strNum % 2 == 1) { System.out.println("No"); } else { StringBuilder output_a = new StringBuilder(); StringBuilder output_b = new StringBuilder(); for(int i=0; i<inputStr.length(); i++) { if(i % 2 == 0) { output_a.append(inputStr.charAt(i)); } else { output_b.append(inputStr.charAt(i)); } } System.out.println("Yes"); System.out.println(output_a.toString() + " " + output_b.toString()); } } }