提出 #8569062


ソースコード 拡げる

#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
void *wmem;
char memarr[96000000];
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline int rd(char c[]){
  int i;
  int sz = 0;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c[sz++] = i;
  for(;;){
    i = getchar_unlocked();
    if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
inline void rd(string &x){
  char *buf = (char *)wmem;
  rd(buf);
  x = buf;
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
int N;
string S;
int main(){
  wmem = memarr;
  rd(N);
  rd(S);
  if(N%2==0 && S.substr(0,N/2)==S.substr(N/2)){
    wt_L("Yes");
    wt_L('\n');
  }
  else{
    wt_L("No");
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20191123-1

// --- original code ---
// int N; string S;
// {
//   rd(N,S);
//   wt( if[N%2==0 && S.substr(0,N/2)==S.substr(N/2), "Yes", "No"] );
// }

提出情報

提出日時
問題 B - Echo
ユーザ LayCurse
言語 C++14 (GCC 5.4.1)
得点 200
コード長 1470 Byte
結果 AC
実行時間 1 ms
メモリ 256 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 11
セット名 テストケース
Sample 00-sample-00, 00-sample-01, 00-sample-02
All 00-sample-00, 00-sample-01, 00-sample-02, 01-handmade-00, 01-handmade-01, 01-handmade-02, 01-handmade-03, 01-handmade-04, 01-handmade-05, 01-handmade-06, 01-handmade-07
ケース名 結果 実行時間 メモリ
00-sample-00 AC 1 ms 256 KiB
00-sample-01 AC 1 ms 256 KiB
00-sample-02 AC 1 ms 256 KiB
01-handmade-00 AC 1 ms 256 KiB
01-handmade-01 AC 1 ms 256 KiB
01-handmade-02 AC 1 ms 256 KiB
01-handmade-03 AC 1 ms 256 KiB
01-handmade-04 AC 1 ms 256 KiB
01-handmade-05 AC 1 ms 256 KiB
01-handmade-06 AC 1 ms 256 KiB
01-handmade-07 AC 1 ms 256 KiB