結果
問題 |
No.1942 Leading zero
|
ユーザー |
![]() |
提出日時 | 2022-05-20 21:29:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 1,426 ms |
コンパイル使用メモリ | 167,948 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-20 07:19:29 |
合計ジャッジ時間 | 1,798 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2022.05.20 21:29:28 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; void solve(string &s) { if (s.size() == 1) return; if (s.back() == '0') { s.pop_back(); solve(s); } } int main() { int n;cin >> n; while(n--) { string s;cin >> s; reverse(s.begin(), s.end()); solve(s); reverse(s.begin(), s.end()); cout << s << endl; } return 0; }