結果

問題 No.714 回転寿司屋のシミュレート
コンテスト
ユーザー tatt61880
提出日時 2021-03-20 05:30:06
言語 Kuin
(KuinC++ v.2021.9.17)
コンパイル:
kuinc -i _filename_ -o out.cpp -s /kuin/sys/ -e cpp -r -q
実行:
./a.out
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 734 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,583 ms
コンパイル使用メモリ 168,124 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-05 17:02:21
合計ジャッジ時間 2,508 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
out.cpp:676:14: warning: first argument in call to 'memset' is a pointer to non-trivially copyable type 'std::shared_ptr<Dict_<std::shared_ptr<Array_<char16_t>>, long>>' [-Wnontrivial-memcall]
  676 |                         memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
      |                                   ^
out.cpp:688:9: note: in instantiation of function template specialization 'newArraysRec_<std::shared_ptr<Array_<std::shared_ptr<Dict_<std::shared_ptr<Array_<char16_t>>, long>>>>>::operator()<long long>' requested here
  688 |         return newArraysRec_<T>()(std::forward<A>(a)...);
      |                ^
out.cpp:1626:11: note: in instantiation of function template specialization 'newArrays_<std::shared_ptr<Array_<std::shared_ptr<Dict_<std::shared_ptr<Array_<char16_t>>, long>>>>, long long>' requested here
 1626 | (k_ao) = (newArrays_<type_(Array_<type_(Dict_<type_(Array_<char16_t>), int64_t>)>)>((21LL)));
      |           ^
out.cpp:676:14: note: explicitly cast the pointer to silence this warning
  676 |                         memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
      |                                   ^
      |                                (void*)
1 warning generated.

ソースコード

diff #
raw source code

func main()
	var n: int :: cui@inputInt()
	var wish: []dict<[]char, int> :: #[21]dict<[]char, int>
	for(1, n)
		switch(cui@inputInt())
		case 0
			var c: int :: cui@inputInt()
			do wish[c] :: #dict<[]char, int>
			var m: int :: cui@inputInt()
			for(1, m)
				var a: []char :: cui@inputStr()
				do wish[c].add(a, wish[c].get(a, &) + 1)
			end for
		case 1
			var b: []char :: cui@inputStr()
			var ans: int :: -1
			for c(1, 20)
				if(wish[c] <>& null)
					var val: int :: wish[c].get(b, &)
					if(val <> 0)
						do wish[c].add(b, val - 1)
						do ans :: c
						break c
					end if
				end if
			end for
			do cui@print("\{ans}\n")
		case 2
			var c: int :: cui@inputInt()
			do wish[c] :: null
		end switch
	end for
end func
0