結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー ks2mks2m
提出日時 2020-04-01 22:46:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,065 bytes
コンパイル時間 2,491 ms
コンパイル使用メモリ 74,200 KB
実行使用メモリ 51,764 KB
最終ジャッジ日時 2023-09-09 19:30:40
合計ジャッジ時間 4,650 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 44 ms
49,048 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 45 ms
49,060 KB
testcase_10 AC 46 ms
49,312 KB
testcase_11 AC 47 ms
49,052 KB
testcase_12 AC 44 ms
49,304 KB
testcase_13 RE -
testcase_14 AC 44 ms
49,128 KB
testcase_15 RE -
testcase_16 AC 45 ms
49,312 KB
testcase_17 AC 44 ms
49,292 KB
testcase_18 AC 44 ms
49,296 KB
testcase_19 AC 45 ms
49,416 KB
testcase_20 WA -
testcase_21 AC 44 ms
48,992 KB
testcase_22 WA -
testcase_23 AC 44 ms
49,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		char[] s = br.readLine().toCharArray();
		br.close();

		for (int i = 0; i < s.length - 2; i++) {
			label:
			for (int j = i + 2; j < s.length; j++) {
				int[] blank = new int[26];
				for (int k = 0; k < i; k++) {
					if (s[k] != ' ') {
						blank[s[k] - 'a'] = 1;
					}
				}
				for (int k = j; k < s.length; k++) {
					if (s[k] != ' ') {
						blank[s[k] - 'a'] = 1;
					}
				}
				for (int k = i; k < j; k++) {
					if ((k - i) % 2 == 0) {
						if (s[k] == ' ' || blank[s[k] - 'a'] == 1) {
							continue label;
						} else {
							blank[s[k] - 'a'] = 2;
						}
					} else {
						if (s[k] != ' ') {
							if (blank[s[k] - 'a'] == 2) {
								continue label;
							} else {
								blank[s[k] - 'a'] = 1;
							}
						}
					}
				}
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}
}
0