結果

問題 No.1942 Leading zero
ユーザー Today03Today03
提出日時 2022-05-21 00:16:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 671 bytes
コンパイル時間 2,088 ms
コンパイル使用メモリ 203,212 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 15:10:44
合計ジャッジ時間 2,572 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define test cout << "test:"
using namespace std;

using P = pair<int, int>;
const int inf = 1073741824;
const long long linf = 1152921504606846976;
// const int mod = 998244353;
// const int mod = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

string z(string s)
{
	reverse(s.begin(), s.end());
	while (s.back() == '0' and s.size() > 1)
		s.pop_back();
	reverse(s.begin(), s.end());
	return s;
}

void _main()
{
	int n;
	cin >> n;

	while (n--)
	{
		string s;
		cin >> s;
		// test;
		cout << z(s) << '\n';
	}
	return;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	_main();
}
0