codeforces 742A-Arpa’s hard exam and Mehrdad’s naive cheat 快速幂
传送门 : CF 742A
题解
直接做8的快速幂, 因为模数是10
用周期做也可以, 不过我优化不到0ms…
AC code
/*adrui's submissionLanguage : C++Result : AcceptedLover : zyyFavorite : Dragon BallsStanding in the Hall of Fame
*/#include<iostream>
using namespace std;#define mod 10int n;int solve(){int res = 1, a = 8;while(n){if(n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;
}int main(){while(cin >> n) cout << solve() << endl;return 0;
}
codeforces 742A-Arpa’s hard exam and Mehrdad’s naive cheat 快速幂相关推荐
- Codeforces 742A Arpa’s hard exam and Mehrdad’s naive cheat 打表+水题
A. Arpa's hard exam and Mehrdad's naive cheat time limit per test 1 second memory limit per test 256 ...
- 【codeforces 742A】Arpa’s hard exam and Mehrdad’s naive cheat
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- Codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution
http://codeforces.com/contest/742/problem/B B. Arpa's obvious problem and Mehrdad's terrible solutio ...
- Codeforces Round #383 (Div. 2) D. Arpa's weak amphitheater and Mehrdad's valuable Hoses —— DP(01背包)
题目链接:http://codeforces.com/contest/742/problem/D D. Arpa's weak amphitheater and Mehrdad's valuable ...
- Codeforces 741 D - Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths
D - Arpa's letter-marked tree and Mehrdad's Dokhtar-kosh paths 思路: 树上启发式合并 从根节点出发到每个位置的每个字符的奇偶性记为每个位 ...
- 【Codeforces 741 B. Arpa's weak amphitheater and Mehrdad's 】+ 并查集 + 01背包
B. Arpa's weak amphitheater and Mehrdad's valuable Hoses time limit per test 1 second memory limit p ...
- Codeforces 742B B. Arpa’s obvious problem and Mehrdad’s terrible solution
B. Arpa's obvious problem and Mehrdad's terrible solution time limit per test 1 second memory limit ...
- CF741D Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths
CF741D Arpa's letter-marked tree and Mehrdad's Dokhtar-kosh paths 好像这个题只能Dsu On Tree? 有根树点分治 统计子树过x的 ...
- 【Codeforces Gym - 101635C Macarons 】【矩阵快速幂+状压】【dfs时间换空间】
[链接] http://codeforces.com/gym/101635/attachments [题意] 求用1*1,1*2的方格填n*m的矩阵的方法数 [知识点] 状压dfs+矩阵快速幂 [分析 ...
最新文章
- IFE JavaScript Task0002-1 小练习1:处理用户输入
- pytorch的梯度计算以及backward方法
- slice切割数组arr=[[0,1],[2,3]]
- HDMI显示器驱动设计与验证
- 【活动】侬好上海,Microsoft Reactor来啦
- el-table中奇偶行背景色显示不同的颜色
- 给做IT的一点心理安慰
- 判断并输出打印前一百个回文素数,每行10个
- 进程间通信之-信号signal--linux内核剖析(九)
- 驾驶证/行驶证信息提取与识别
- DTCMS添加栏目教程
- win10电脑不显示手机连接服务器失败,技术员教你解决win10系统手机连接不上电脑没反应的操作办法...
- 三种形式全排列——指数型、排列型、组合型类型题目汇总
- 【寻找最佳小程序】09期:轻芒杂志——杂志感设计,美美地阅读各领域杂志...
- 5464: Star Arrangements
- 微服务架构开发实战:什么是微服务的熔断机制和熔断的意义
- 阿里云买的域名备案成功了 后续怎么建站 ?
- 《计算之魂》第1章 毫厘千里之差——大O概念(1.4节)
- 经验:怎么样免费在线PDF拆分
- linux认证版本,LPI Linux认证考试教程 中文PDF最新版
热门文章
- 如何下载centos dvd版本
- Android ImageView 的scaleType 属性
- 测试端口通不通(四种方法)
- 手机上pdf转换成word怎么转
- 再不懂时序就 OUT 啦!,DBengine 排名第一时序数据库,阿里云数据库 InfluxDB 正式商业化!...
- WM SCM630 笔记 Unit 4 Putaway Control (2)
- 《SpringBoot篇》19.SpringBoot整合Quart
- 海康威视摄像头自带网页自动登录
- Java 封装基础知识
- anaconda添加源-创建环境-pycharm使用anaconda环境