結果

問題 No.739 大事なことなので2度言います
ユーザー gon_027
提出日時 2019-09-12 21:07:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 65,812 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-02 17:09:55
合計ジャッジ時間 1,425 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main(){
    string s;
    cin >> s;

    //cout << s.size() << endl;

    if(s.size() % 2 != 0) {
        cout << "NO" << endl;
        return 0;
    }

    string s1;
    for(int i = 0; i < s.size() / 2; i++){
        s1 += s[i];
    }

    string s2;
    for (int i = s.size() / 2; i < s.size(); i++){
        s2 += s[i];
    }

    //cout << s1 << " " << s2 << endl;

    if(s1 == s2){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}
0