結果

問題 No.3505 Sum of Prod of Root
コンテスト
ユーザー ID 21712
提出日時 2026-04-18 22:36:31
言語 Go
(1.26.1)
コンパイル:
env GOCACHE=/tmp go build _filename_
実行:
./Main
結果
WA  
実行時間 -
コード長 705 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,122 ms
コンパイル使用メモリ 284,540 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2026-04-18 22:36:58
合計ジャッジ時間 12,366 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package main

import . "fmt"
import . "math"

const M = 998244353

func main() {
	var n int
	Scan(&n)
	if n > 1e6 {
		Println(-1)
		return
	}
	ans := 0
	for i := 1; i <= n; i++ {
		s := 1
		for k := 1; ; k++ {
			x := int(Floor(Pow(float64(i),1/float64(k))))
			s = s*x%M
			if x == 1 {
				break
			}
		}
		ans = (ans+s)%M
	}
	
	Println(ans)
}

func init() {
	// check()
}

func check() {
	ans := 0
	for i := 1; i < 200; i++ {
		println("i=",i)
		print("  ")
		s := 1
		for k := 1; ; k++ {
			x := int(Floor(Pow(float64(i), 1/float64(k))))
			s = s*x%M
			print(x,",")
			if x== 1 {
				println()
				println("  k=",k)
				break
			}
		}
		ans = (ans+s)%M
		println("  s=",s)
		println("  ans=",ans)
	}
}
0