結果

問題 No.1617 Palindrome Removal
ユーザー 👑 tatt61880tatt61880
提出日時 2021-07-23 04:19:56
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 2,059 ms
コンパイル使用メモリ 150,940 KB
実行使用メモリ 7,896 KB
最終ジャッジ日時 2023-10-14 18:38:09
合計ジャッジ時間 4,817 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
7,512 KB
testcase_01 AC 87 ms
7,528 KB
testcase_02 AC 83 ms
7,532 KB
testcase_03 AC 81 ms
7,840 KB
testcase_04 AC 92 ms
7,580 KB
testcase_05 AC 73 ms
7,776 KB
testcase_06 AC 16 ms
7,748 KB
testcase_07 AC 13 ms
7,576 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 127 ms
7,896 KB
testcase_11 AC 112 ms
7,636 KB
testcase_12 AC 137 ms
7,772 KB
testcase_13 AC 139 ms
7,744 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
testcase_21 AC 2 ms
4,356 KB
testcase_22 AC 1 ms
4,352 KB
testcase_23 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var s: []char :: cui@input()
	var t: []char :: ##s
	var n: int :: ^s
	do t.reverse()
	var ans: int
	if(s <> t)
		do ans :: n
	else
		do s.sort()
		do t.sort()
		do t.reverse()
		if(s = t)
			do ans :: -(n % 2)
		elif(n = 3)
			do ans :: -1
		else
			do ans :: n - 2
		end if
	end if
	do cui@print("\{ans}\n")
end func
0