Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoYuKai-SaMuEl committed Sep 25, 2024
1 parent bea69cd commit 2096725
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pF/statement/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 又一個簡短的問題

輸入兩個正整數 $n,m$,請輸出第 $m$ 小的非負整數 $k$ 滿足 $2^k$ 除以 $10^{12}+39$ 的餘數為 $n$。若找不到滿足條件的第 $m$ 小的非負整數 $k$ 請輸出 $-1$。
輸入兩個正整數 $n,m$,請輸出第 $m$ 小的非負整數 $k$ 滿足 $2^k$ 除以 $10^{12}+39$ 的餘數為 $n$。若找不到滿足條件的第 $m$ 小的非負整數 $k$ 請輸出 $-1$。\
(提示:C++有內建型別「__int128_t」可以儲存128-bit整數,惟無法直接進行輸出,但在本題若出現long long int相乘導致的溢位,可以使用「(__int128_t)x*y%(long long int)(1e12+39)」(其中x,y是long long int),來將運算結果暫時轉為__int128_t避免溢位,再取模後即可存入long long int變數內。另外 $10^{12}+39$ 是質數。)

## 輸入
輸入只有一行,包含兩個正整數 $n,m$,意義如題目所述。
Expand Down

0 comments on commit 2096725

Please sign in to comment.