提出 #21648073


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;


int main(){
    string s; cin >> s;
    if(s[0]=='0'){
        cout << "Yes" << endl;
        return 0;
    }
    int n=s.length();
    int zero=n;
    for(int i=n-1;i>=0;i--){
        if(s[i]=='0') continue;
        zero=i;break; 
    }
    bool ans=true;
    for(int i=0;i<zero;i++){
        if(s[i]!=s[zero-i]) ans=false;
    }
    if(ans) cout << "Yes" << endl;
    else cout <<"No" << endl;
}

提出情報

提出日時
問題 B - Palindrome with leading zeros
ユーザ nagoriyuki
言語 C++ (GCC 9.2.1)
得点 200
コード長 490 Byte
結果 AC
実行時間 6 ms
メモリ 3628 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 25
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, random_01.txt, random_02.txt, random_03.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 6 ms 3576 KiB
hand_02.txt AC 2 ms 3600 KiB
hand_03.txt AC 2 ms 3472 KiB
hand_04.txt AC 2 ms 3572 KiB
hand_05.txt AC 6 ms 3436 KiB
hand_06.txt AC 2 ms 3624 KiB
hand_07.txt AC 2 ms 3436 KiB
hand_08.txt AC 2 ms 3520 KiB
hand_09.txt AC 2 ms 3472 KiB
hand_10.txt AC 2 ms 3424 KiB
hand_11.txt AC 2 ms 3496 KiB
hand_12.txt AC 2 ms 3420 KiB
hand_13.txt AC 2 ms 3496 KiB
hand_14.txt AC 3 ms 3496 KiB
hand_15.txt AC 2 ms 3592 KiB
hand_16.txt AC 2 ms 3552 KiB
hand_17.txt AC 2 ms 3460 KiB
hand_18.txt AC 2 ms 3424 KiB
hand_19.txt AC 2 ms 3548 KiB
random_01.txt AC 4 ms 3496 KiB
random_02.txt AC 3 ms 3492 KiB
random_03.txt AC 2 ms 3628 KiB
sample_01.txt AC 2 ms 3596 KiB
sample_02.txt AC 2 ms 3600 KiB
sample_03.txt AC 2 ms 3596 KiB