2020.12.30开始学习AcWing算法《算法竞赛进阶指南》;
上传博客方便复习。
//Wecccccccc
//2020.12.30
#include <iostream>
using namespace std;
typedef unsigned long long int ull;int main() {ull a, b, c;cin >> a >> b >> c;ull ans = 0;while (b) {if (b & 1) {ans = (ans + a) % c;}a = a * 2 % c;b >>= 1;}cout << ans << endl;return 0;
}