結果

問題 No.74 貯金箱の退屈
ユーザー tailstails
提出日時 2019-08-18 20:14:30
言語 Bash
(Bash 5.2.21)
結果
AC  
実行時間 7 ms / 5,000 ms
コード長 266 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 7,204 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 14:17:27
合計ジャッジ時間 1,612 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

f=x-u[x]?x=u[x],f:x
u=({0..99})
e=8
read n
read -ad
read -aw
for((i=0;i<n;++i)){
	((x=a=(i+d[i]%n+n)%n,y=f))
	((x=b=(i-d[i]%n+n)%n,z=f))
	((a-b?(u[y]=z):(w[a]=e*=3)))
}
for((i=0;i<n;++i)){
	((s[x=i,f]^=w[i]^1))
}
for s in ${s[@]};{
	((t+=s==1))
}
Yes
echo ${_[t]-No}
0