【Hello 2018 A】 Modular Exponentiation
2018-01-09 09:49
232 查看
【链接】 我是链接,点我呀:)
【题意】
在这里输入题意
【题解】
当a<b的时候
a%b==a
显然2^n增长很快的。
当2^n>=1e8的时候,直接输出m就可以了
【代码】
#include <bits/stdc++.h> #define ll long long using namespace std; ll n,m; int main(){ #ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", stdin); #endif ios::sync_with_stdio(0),cin.tie(0); cin >> n >> m; //m%2^n if (n>=32){ cout << m << endl; }else{ ll now = 1; for (int i = 1;i <= n;i++) now = now*2; cout << m%now<<endl; } return 0; }
相关文章推荐
- Hello 2018 B
- Hello 2018 A - D 题解
- Codeforces Hello 2018 C. Party Lemonade(思维)
- Codeforces Hello 2018 C. Party Lemonade 贪心、优先队列
- Codeforces Hello 2018 - A - Modular Exponentiation
- Hello 2018 - (A,B,C)
- codeforces Hello 2018 C. Party Lemonade(贪心)
- Codeforces Hello 2018
- Codeforces Hello 2018 D. Too Easy Problems 二分+贪心
- Codeforces Hello 2018 - B - Christmas Spruce
- codeforces Hello 2018 C. Party Lemonade(DP+思维)
- Hello 2018 C. Party Lemonade(二进制技巧+dp思想)
- CodeForces - Hello 2018 B(树的遍历). C(贪心)
- Codeforces Hello 2018 - C - Party Lemonade
- Hello 2018-A. Modular Exponentiation
- CF hello 2018(A~E)
- Hello 2018 B. Christmas Spruce 水题
- Good Bye 2017-Hello 2018
- Codeforces Hello 2018 - D - Too Easy Problems
- Hello 2018