|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|20 초||512 MB||11||3||3||42.857%|
An amateur Viking historian needs your help finding the silver left by Egill Skallagrímsson, of Egil's saga. She has found two old treasure maps that are supposed to lead to it. A treasure map is a list of instructions of the form "direction $k$", where direction can be "n", "s", "e", or "w". The maps are sadly old, so some of the instructions are missing and we represent them with a simple "?" instead.
The first map is larger while the second map is a smaller fragment. She wants to know how she can overlay her maps such that they coincide.
Two maps coincide if the corresponding instructions are either identical or at least one of them is lost to time. All instructions must have a corresponding instruction on the other map when overlaying the maps.
Output the number of indices such that if the second map was overlaid at this index on the first map then they would coincide.
4 3 n 4 e 1 ? s 5 ? e 1 ?
4 3 n 4 e 1 w 3 s 5 ? e 1 ?