結果

問題 No.739 大事なことなので2度言います
ユーザー Akihisa.K
提出日時 2018-11-03 19:25:21
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-20 19:33:15
合計ジャッジ時間 600 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>

int main(void){
    int len,i=0;
    char in[21],rslt[4],half[21],tmp[21];

    scanf("%s",in);
    for(i=0;;i++){
        if(i==20)break;
        if(in[i]=='\n'||in[i]=='\0')break;
    }
    for(int j=0;j<i/2;j++){
        half[j]=in[j];
    }
    strcpy(tmp,half);
    strcat(tmp,half);
    len=strncmp(tmp,in,i);

    if(len==0){
        strcpy(rslt,"YES");
    }else{
        strcpy(rslt,"NO");
    }

    printf("%s\n",rslt);
    return 0;
}
0