結果

問題 No.2030 Googol Strings
ユーザー どららどらら
提出日時 2022-08-05 22:18:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 852 bytes
コンパイル時間 4,661 ms
コンパイル使用メモリ 227,224 KB
実行使用メモリ 7,048 KB
最終ジャッジ日時 2023-10-13 23:31:06
合計ジャッジ時間 5,695 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
4,348 KB
testcase_01 AC 17 ms
4,348 KB
testcase_02 AC 14 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 36 ms
4,348 KB
testcase_05 AC 19 ms
4,348 KB
testcase_06 AC 38 ms
5,580 KB
testcase_07 AC 56 ms
7,040 KB
testcase_08 AC 56 ms
7,048 KB
testcase_09 AC 42 ms
4,352 KB
testcase_10 AC 43 ms
4,352 KB
testcase_11 AC 43 ms
4,352 KB
testcase_12 AC 61 ms
4,348 KB
testcase_13 AC 59 ms
4,352 KB
testcase_14 AC 27 ms
4,480 KB
testcase_15 AC 72 ms
4,348 KB
testcase_16 AC 53 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;
//using mint = modint1000000007;
//using mint = modint998244353;

void solve(){
  string x, y;
  cin >> x;
  cin >> y;

  rep(i,2*max(x.size(),y.size())){
    if(x[i%x.size()] < y[i%y.size()]){
      cout << "Y" << endl;
      return;
    }
    if(x[i%x.size()] > y[i%y.size()]){
      cout << "X" << endl;
      return;
    }
  }

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

int main(){
  int T;
  cin >> T;
  rep(t,T){
    solve();
  }
  
  return 0;
}
0