結果

問題 No.290 1010
ユーザー Kmcode1
提出日時 2015-10-16 22:40:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 659 ms / 5,000 ms
コード長 897 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 91,980 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-21 19:50:01
合計ジャッジ時間 2,906 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:32:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   32 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
main.cpp:33:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   33 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
using namespace std;
int n;
string S;
string ss;
char s[1000002];
int main() {
scanf("%d", &n);
scanf("%s", s);
//string ss = s;
ss = s;
for (int k = 1;k <= ss.size()&&clock()/(double)(CLOCKS_PER_SEC)<4.8;k++) {
for (int i = 0;i < ss.size()&&clock()/(double)(CLOCKS_PER_SEC)<4.8;i++) {
if (i + k * 2 > ss.size()) {
break;
}
S = ss.substr(i, k);
if (S == ss.substr(i+k, k)) {
puts("YES");
return 0;
}
}
}
puts("NO");
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0