結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
コンテスト
ユーザー tatt61880
提出日時 2023-02-12 06:57:41
言語 Kuin
(KuinC++ v.2021.9.17)
コンパイル:
kuinc -i _filename_ -o out.cpp -s /kuin/sys/ -e cpp -r -q
実行:
./a.out
結果
WA  
実行時間 -
コード長 547 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,210 ms
コンパイル使用メモリ 167,040 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-30 16:38:58
合計ジャッジ時間 3,395 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
out.cpp:676:14: warning: first argument in call to 'memset' is a pointer to non-trivially copyable type 'std::shared_ptr<Array_<char16_t>>' [-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<Array_<char16_t>>>>>::operator()<long>' requested here
  688 |         return newArraysRec_<T>()(std::forward<A>(a)...);
      |                ^
out.cpp:1856:11: note: in instantiation of function template specialization 'newArrays_<std::shared_ptr<Array_<std::shared_ptr<Array_<char16_t>>>>, long>' requested here
 1856 | (k_fs) = (newArrays_<type_(Array_<type_(Array_<char16_t>)>)>(((k_fq)->Len())));
      |           ^
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 a: []char :: cui@input()
	do a.reverse()
	
	var v: int :: 0
	var nums: []int :: #[8]int
	for i(0, ^a - 1)
		do v :+ (a[i] $ int - 'A' $ int + 10) * (16 ^ (i % 4))
		if(i % 4 = 3 | i = ^a - 1)
			var digit: int :: 0
			while(v <> 0 | (i <> ^a - 1 & digit < 4))
				do nums[v % 8] :+ 1
				do v :/ 8
				do digit :+ 1
			end while
			do v :: 0
		end if
	end for
	
	var max: int :: nums.max()
	var ans: []int :: #[0]int
	for i(0, 7)
		if(nums[i] = max)
			do ans :~ [i]
		end if
	end for
	do cui@print("\{ans.join(" ")}\n")
end func
0