結果

問題 No.2030 Googol Strings
ユーザー olpheolphe
提出日時 2022-08-05 21:34:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 1,088 bytes
コンパイル時間 1,228 ms
コンパイル使用メモリ 128,324 KB
実行使用メモリ 13,376 KB
最終ジャッジ日時 2023-10-13 22:06:19
合計ジャッジ時間 2,349 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
4,348 KB
testcase_01 AC 3 ms
4,352 KB
testcase_02 AC 6 ms
5,100 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 20 ms
4,348 KB
testcase_05 AC 3 ms
4,352 KB
testcase_06 AC 12 ms
13,376 KB
testcase_07 AC 6 ms
5,416 KB
testcase_08 AC 7 ms
5,408 KB
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 4 ms
4,348 KB
testcase_11 AC 4 ms
4,348 KB
testcase_12 AC 22 ms
4,352 KB
testcase_13 AC 10 ms
4,348 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 18 ms
4,512 KB
testcase_16 AC 9 ms
4,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> T;
	while (T--) {
		string s, t;
		cin >> s >> t;
		bool flag = false;
		if (s.size() > t.size()) {
			swap(s, t);
			flag = true;
		}
		if (s > t) {
			flag ^= true;
		}
		else {
			string u, v;
			while (u.size() < t.size() * 3) {
				u += s;
			}
			while (v.size() < t.size() * 3) {
				v += t;
			}
			u.resize(v.size());
			if (u > v)flag ^= true;
		}
		if (flag) {
			cout << "X" << endl;
		}
		else {
			cout << "Y" << endl;
		}
	}
}
0