結果
| 問題 |
No.2030 Googol Strings
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-06 02:14:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 901 bytes |
| コンパイル時間 | 1,906 ms |
| コンパイル使用メモリ | 193,316 KB |
| 最終ジャッジ日時 | 2025-01-30 18:57:01 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <algo/debug.h>
#else
#define debug(...) 42
#endif
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
string x, y;
cin >> x >> y;
int n = (int) min(x.size(), y.size());
int ans = -1;
for (int i = 0; i < n; i++) {
if (x[i] < y[i]) {
ans = 0;
} else if (x[i] > y[i]) {
ans = 1;
}
}
if (ans == -1) {
n = 2 * max((int) x.size(), (int) y.size());
for (int i = 0; i < n; i++) {
int px = i % (int) x.size();
int py = i % (int) y.size();
if (x[px] < y[py]) {
ans = 0;
} else if (x[px] > y[py]) {
ans = 1;
}
}
}
if (ans == -1) {
ans = (x.size() < y.size() ? 0 : 1);
}
cout << (ans == 0 ? "Y" : "X") << '\n';
}
return 0;
}