题目描述
blablabla
样例
blablabla
blablabla
C++ 代码
#include <bits/stdc++.h>
#define res using namespace std;typedef long long LL;int main() { LL a, b, c, res = 0; cin >> a >> b >> c; do { if(b & 1) res = (res + a) % c; a = a * 2 % c; } while(b >>= 1); cout << res << endl;}
res