結果
問題 | No.1942 Leading zero |
ユーザー |
![]() |
提出日時 | 2022-05-21 00:16:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 671 bytes |
コンパイル時間 | 1,800 ms |
コンパイル使用メモリ | 195,420 KB |
最終ジャッジ日時 | 2025-01-29 12:17:38 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 |
ソースコード
#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(); }