結果

問題 No.2030 Googol Strings
コンテスト
ユーザー kokatsu
提出日時 2023-01-25 20:23:57
言語 D
(dmd 2.112.0)
コンパイル:
dmd -fPIE -m64 -w -wi -O -release -inline -I/opt/dmd/src/druntime/import/ -I/opt/dmd/src/phobos -L-L/opt/dmd/linux/lib64/ -fPIC _filename_
実行:
./Main
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 418 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,719 ms
コンパイル使用メモリ 190,276 KB
実行使用メモリ 11,308 KB
最終ジャッジ日時 2026-03-06 22:36:39
合計ジャッジ時間 3,692 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import std;

void main() {
    int T;
    readf("%d\n", T);

    string f(string x, string y) {
        string u = x ~ y, v = y ~ x;
        if (u > v) return "X";
        else if (u < v) return "Y";

        auto a = x.length, b = y.length;
        if (a > b) return "X";
        else return "Y";
    }

    foreach (_; 0 .. T) {
        string x, y;
        readf("%s\n%s\n", x, y);

        f(x, y).writeln;
    }
}
0