結果
問題 | No.1942 Leading zero |
ユーザー | 🍮かんプリン |
提出日時 | 2022-05-20 21:29:30 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 1,549 ms |
コンパイル使用メモリ | 167,760 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-20 11:47:30 |
合計ジャッジ時間 | 1,888 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,348 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 17 ms
4,348 KB |
ソースコード
/** * @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; }