提出 #42897763


ソースコード 拡げる

import std;

void main () {
    int N = readln.chomp.to!int;
    string[] S;
    foreach (_; 0..N) {
        S ~= readln.chomp;
    }

    solve(N, S);
}

void solve (int N, string[] S) {
    foreach (i; 0..N) {
        foreach (j; 0..N) {
            if (i == j) {
                continue;
            }
            if (is_palindrome(S[i]~S[j])) {
                writeln("Yes");
                return;
            }
        }
    }
    writeln("No");
}

bool is_palindrome (string S) {
    bool res = true;
    foreach (i; 0..S.length) {
        if (S.length - i - 1 <= i) {
            break;
        }
        if (S[i] != S[$-1-i]) {
            res = false;
            break;
        }
    }
    return res;
}

提出情報

提出日時
問題 B - racecar
ユーザ InTheBloom
言語 D (DMD 2.091.0)
得点 200
コード長 758 Byte
結果 AC
実行時間 9 ms
メモリ 4472 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 30
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 7 ms 3560 KiB
example_01.txt AC 2 ms 3508 KiB
example_02.txt AC 3 ms 3640 KiB
hand_00.txt AC 2 ms 3620 KiB
hand_01.txt AC 6 ms 4332 KiB
hand_02.txt AC 3 ms 3908 KiB
hand_03.txt AC 2 ms 3436 KiB
hand_04.txt AC 2 ms 3552 KiB
hand_05.txt AC 3 ms 3672 KiB
hand_06.txt AC 3 ms 3876 KiB
random_00.txt AC 6 ms 4060 KiB
random_01.txt AC 5 ms 4324 KiB
random_02.txt AC 6 ms 3976 KiB
random_03.txt AC 4 ms 4056 KiB
random_04.txt AC 5 ms 4404 KiB
random_05.txt AC 6 ms 4380 KiB
random_06.txt AC 3 ms 3780 KiB
random_07.txt AC 5 ms 4236 KiB
random_08.txt AC 5 ms 4384 KiB
random_09.txt AC 5 ms 4004 KiB
random_10.txt AC 6 ms 4408 KiB
random_11.txt AC 6 ms 4416 KiB
random_12.txt AC 8 ms 4472 KiB
random_13.txt AC 8 ms 4428 KiB
random_14.txt AC 9 ms 4036 KiB
random_15.txt AC 7 ms 4260 KiB
random_16.txt AC 5 ms 3964 KiB
random_17.txt AC 6 ms 4284 KiB
random_18.txt AC 6 ms 4028 KiB
random_19.txt AC 6 ms 4316 KiB