結果

問題 No.2030 Googol Strings
ユーザー umezoumezo
提出日時 2022-08-06 01:25:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 1,816 ms
コンパイル使用メモリ 194,364 KB
最終ジャッジ日時 2025-01-30 18:56:05
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 12 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int t;
  cin>>t;
  while(t--){
    string s,t;
    cin>>s>>t;
    s+=s,t+=t;
    int a=s.size(),b=t.size();
    bool f=false;
    rep(i,min(a,b)){
      if(s[i]>t[i]){
        cout<<'X'<<endl;
        f=true;
        break;
      }
      else if(s[i]<t[i]){
        cout<<'Y'<<endl;
        f=true;
        break;
      }
    }
    if(f) continue;
    if(a>b) cout<<'X'<<endl;
    else cout<<'Y'<<endl;
  }
  
  return 0;
}
0