結果

問題 No.2030 Googol Strings
ユーザー simansiman
提出日時 2022-12-08 02:34:46
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 695 bytes
コンパイル時間 3,042 ms
コンパイル使用メモリ 137,216 KB
実行使用メモリ 11,968 KB
最終ジャッジ日時 2024-04-22 05:33:58
合計ジャッジ時間 5,344 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
5,248 KB
testcase_01 AC 20 ms
5,248 KB
testcase_02 AC 16 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 36 ms
5,376 KB
testcase_05 AC 16 ms
5,376 KB
testcase_06 AC 35 ms
10,620 KB
testcase_07 AC 47 ms
11,964 KB
testcase_08 AC 47 ms
11,968 KB
testcase_09 AC 19 ms
5,376 KB
testcase_10 AC 21 ms
5,376 KB
testcase_11 AC 20 ms
5,376 KB
testcase_12 AC 40 ms
5,376 KB
testcase_13 AC 31 ms
5,376 KB
testcase_14 AC 19 ms
5,376 KB
testcase_15 AC 34 ms
5,376 KB
testcase_16 AC 42 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <climits>
#include <map>
#include <queue>
#include <set>
#include <cstring>
#include <vector>

using namespace std;
typedef long long ll;

void solver(string x, string y) {
  string s1 = x + y;
  string s2 = y + x;

  if (s1 > s2) {
    cout << "X" << endl;
  } else if (s1 < s2) {
    cout << "Y" << endl;
  } else {
    if (x.size() > y.size()) {
      cout << "X" << endl;
    } else {
      cout << "Y" << endl;
    }
  }
}

int main() {
  int T;
  cin >> T;

  for (int i = 0; i < T; ++i) {
    string x;
    string y;
    cin >> x;
    cin >> y;

    solver(x, y);
  }

  return 0;
}
0