传送门 : 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 快速幂相关推荐

  1. 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 ...

  2. 【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 ...

  3. 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 ...

  4. 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 ...

  5. 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 思路: 树上启发式合并 从根节点出发到每个位置的每个字符的奇偶性记为每个位 ...

  6. 【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 ...

  7. 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 ...

  8. 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的 ...

  9. 【Codeforces Gym - 101635C Macarons 】【矩阵快速幂+状压】【dfs时间换空间】

    [链接] http://codeforces.com/gym/101635/attachments [题意] 求用1*1,1*2的方格填n*m的矩阵的方法数 [知识点] 状压dfs+矩阵快速幂 [分析 ...

最新文章

  1. IFE JavaScript Task0002-1 小练习1:处理用户输入
  2. pytorch的梯度计算以及backward方法
  3. slice切割数组arr=[[0,1],[2,3]]
  4. HDMI显示器驱动设计与验证
  5. 【活动】侬好上海,Microsoft Reactor来啦
  6. el-table中奇偶行背景色显示不同的颜色
  7. 给做IT的一点心理安慰
  8. 判断并输出打印前一百个回文素数,每行10个
  9. 进程间通信之-信号signal--linux内核剖析(九)
  10. 驾驶证/行驶证信息提取与识别
  11. DTCMS添加栏目教程
  12. win10电脑不显示手机连接服务器失败,技术员教你解决win10系统手机连接不上电脑没反应的操作办法...
  13. 三种形式全排列——指数型、排列型、组合型类型题目汇总
  14. 【寻找最佳小程序】09期:轻芒杂志——杂志感设计,美美地阅读各领域杂志...
  15. 5464: Star Arrangements
  16. 微服务架构开发实战:什么是微服务的熔断机制和熔断的意义
  17. 阿里云买的域名备案成功了 后续怎么建站 ?
  18. 《计算之魂》第1章 毫厘千里之差——大O概念(1.4节)
  19. 经验:怎么样免费在线PDF拆分
  20. linux认证版本,LPI Linux认证考试教程 中文PDF最新版

热门文章

  1. 如何下载centos dvd版本
  2. Android ImageView 的scaleType 属性
  3. 测试端口通不通(四种方法)
  4. 手机上pdf转换成word怎么转
  5. 再不懂时序就 OUT 啦!,DBengine 排名第一时序数据库,阿里云数据库 InfluxDB 正式商业化!...
  6. WM SCM630 笔记 Unit 4 Putaway Control (2)
  7. 《SpringBoot篇》19.SpringBoot整合Quart
  8. 海康威视摄像头自带网页自动登录
  9. Java 封装基础知识
  10. anaconda添加源-创建环境-pycharm使用anaconda环境