結果
| 問題 |
No.1942 Leading zero
|
| コンテスト | |
| ユーザー |
myiru
|
| 提出日時 | 2022-05-24 21:56:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 2,000 ms |
| コード長 | 759 bytes |
| コンパイル時間 | 1,669 ms |
| コンパイル使用メモリ | 170,628 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-20 14:31:33 |
| 合計ジャッジ時間 | 1,834 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;string s[10001];
for(int i=0;i<n;i++){cin>>s[i];
if(s[i].at(0)=='0'&&s[i].at(1)=='0'&&s[i].at(2)=='0'&&s[i].at(3)=='0'&&s[i].at(4)=='0')
{cout<<"0"<<endl;}
else if(s[i].at(0)=='0'&&s[i].at(1)=='0'&&s[i].at(2)=='0'&&s[i].at(3)=='0')
{cout<<s[i].at(4)<<endl;}
else if(s[i].at(0)=='0'&&s[i].at(1)=='0'&&s[i].at(2)=='0')
{cout<<s[i].at(3)<<s[i].at(4)<<endl;}
else if(s[i].at(0)=='0'&&s[i].at(1)=='0')
{cout<<s[i].at(2)<<s[i].at(3)<<s[i].at(4)<<endl;}
else if(s[i].at(0)=='0')
{cout<<s[i].at(1)<<s[i].at(2)<<s[i].at(3)<<s[i].at(4)<<endl;}
else{cout<<s[i]<<endl;}
}
return 0;
}
myiru