結果

問題 No.203 ゴールデン・ウィーク(1)
コンテスト
ユーザー 6soukiti29
提出日時 2019-07-20 14:22:56
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 283 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,481 ms
コンパイル使用メモリ 67,140 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-23 10:08:45
合計ジャッジ時間 2,879 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 17) Warning: imported and not used: 'strutils' [UnusedImport]

ソースコード

diff #
raw source code

import sequtils,strutils
var
    a1 = stdin.readline
    a2 = stdin.readline
    ans = 0
a1 &= a2

for i in 0..a1.high:
    for j in 0..a1.high:
        if i + j > a1.high:
            break
        if a1[i + j] != a1[i]:
            break
        ans = max(j + 1, ans)
echo ans
    
0