64位整数乘法

Luogu
IDLGP10446
Time1000ms
Memory512MB
DifficultyP2
求 $a$ 乘 $b$ 对 $p$ 取模的值。 ## Input 第一行输入整数 $a$,第二行输入整数 $b$,第三行输入整数 $p$。 ## Output 输出一个整数,表示 `a*b mod p` 的值。 [samples] ## Note $1 \le a,b,p \le 10^{18}$
Samples
Input #1
3
4
5
Output #1
2
API Response (JSON)
{
  "problem": {
    "name": "64位整数乘法",
    "description": {
      "content": "求 $a$ 乘 $b$ 对 $p$ 取模的值。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP10446"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "求 $a$ 乘 $b$ 对 $p$ 取模的值。\n\n## Input\n\n第一行输入整数 $a$,第二行输入整数 $b$,第三行输入整数 $p$。\n\n## Output\n\n输出一个整数,表示 `a*b mod p` 的值。\n\n[samples]\n\n## Note\n\n$1 \\le a,b,p \\le 10^{18}$...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments