結果

問題 No.2030 Googol Strings
ユーザー umezoumezo
提出日時 2022-08-06 01:25:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 199,916 KB
実行使用メモリ 8,076 KB
最終ジャッジ日時 2023-10-14 03:37:03
合計ジャッジ時間 3,780 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
4,356 KB
testcase_01 AC 3 ms
4,352 KB
testcase_02 AC 4 ms
4,356 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 8 ms
7,120 KB
testcase_07 AC 10 ms
8,076 KB
testcase_08 AC 11 ms
8,048 KB
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 4 ms
4,348 KB
testcase_11 AC 4 ms
4,352 KB
testcase_12 AC 19 ms
4,352 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 7 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

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