結果

問題 No.290 1010
ユーザー LeonardoneLeonardone
提出日時 2015-10-16 22:37:01
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 11,220 KB
実行使用メモリ 119,964 KB
最終ジャッジ日時 2023-09-29 00:38:57
合計ジャッジ時間 9,718 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,128 KB
testcase_01 AC 83 ms
15,216 KB
testcase_02 AC 82 ms
15,220 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 83 ms
15,140 KB
testcase_06 AC 83 ms
15,224 KB
testcase_07 AC 82 ms
15,332 KB
testcase_08 AC 82 ms
15,168 KB
testcase_09 AC 82 ms
15,228 KB
testcase_10 AC 82 ms
15,220 KB
testcase_11 AC 82 ms
15,032 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 83 ms
15,136 KB
testcase_15 AC 81 ms
15,252 KB
testcase_16 AC 82 ms
15,164 KB
testcase_17 AC 82 ms
15,228 KB
testcase_18 AC 83 ms
15,152 KB
testcase_19 AC 83 ms
15,180 KB
testcase_20 AC 87 ms
17,320 KB
testcase_21 AC 85 ms
17,188 KB
testcase_22 TLE -
testcase_23 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#! ruby
# Try yukicoder
# author: Leornadone @ NEETSDKASU

N = gets.to_i
S = gets.chomp

# S[i,j]
# S[j+1,j+(j+1-i)] = S[j+1,j+1+(j-i)]

N.times do |i|
	N.times do |j|
		b2 = j + (j + 1 - i)
		break if b2 > N
		if S[i..j] == S[j+1,b2]
			puts "YES"
			exit
		end
	end
end

puts "NO"
0