2018 CCPC网络赛 几道数学题
1002 Congruence equation
题目链接 : http://acm.hdu.edu.cn/showproblem.php?pid=6439
题解 : https://www.zybuluo.com/yang12138/note/1262592
相关定理 : 裴蜀定理
ax+by=1
1003 Dream
http://www.cnblogs.com/xiuwenli/p/9534918.html
#include<bits/stdc++.h>
using namespace std;
const int maxn =1e5+;
typedef long long LL; int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int p;
int T; scanf("%d",&T);
while(T--){
scanf("%d",&p);
for(int i=;i<p;++i){
for(int j=;j<p;++j){
printf("%d%c",(i+j)%p,j==p-?'\n':' ');
}
}
for(int i=;i<p;++i){
for(int j=;j<p;++j){
printf("%d%c",(i*j%p),j==p-?'\n':' ');
}
}
}
return ;
}
1004 Find Integer
费马大定理 (话说今年的题使费马出的嘛, 比较简单的签到题)
1005 GuGu Convolution
2018 CCPC网络赛 几道数学题的更多相关文章
- 2018 CCPC网络赛
2018 CCPC网络赛 Buy and Resell 题目描述:有一种物品,在\(n\)个地点的价格为\(a_i\),现在一次经过这\(n\)个地点,在每个地点可以买一个这样的物品,也可以卖出一个物 ...
- 2018 CCPC网络赛 hdu6444 Neko's loop
题目描述: Neko has a loop of size n.The loop has a happy value ai on the i−th(0≤i≤n−1) grid. Neko likes ...
- 2018 CCPC 网络赛 Buy and Resell
The Power Cube is used as a stash of Exotic Power. There are n cities numbered 1,2,…,n where allowed ...
- 2018 CCPC网络赛 1010 hdu 6447 ( 树状数组优化dp)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6447 思路:很容易推得dp转移公式:dp[i][j] = max(dp[i][j-1],dp[i-1][j ...
- 【2018 CCPC网络赛 1004】Find Integer(勾股数+费马大定理)
Problem Description people in USSS love math very much, and there is a famous math problem . give yo ...
- 【2018 CCPC网络赛】1001 - 优先队列&贪心
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6438 获得最大的利润,将元素依次入栈,期中只要碰到比队顶元素大的,就吧队顶元素卖出去,答案加上他们期中 ...
- 【2018 CCPC网络赛】1009 - 树
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6446 题目给出的数据为一棵树,dfs扫描每条边,假设去掉某条边,则左边 x 个点,右边 n-x 个点, ...
- 【2018 CCPC网络赛】1003 - 费马小定理
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6440 这题主要是理解题意: 题意:定义一个加法和乘法,使得 (m+n)p = mp+np; 其中给定 ...
- 【2018 CCPC网络赛】1004 - 费马大定理&数学
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6441 Knowledge Point: 1. 费马大定理:当整数n >2时,关于x, y, z的 ...
随机推荐
- 【C语言程序】法雷数列
对任意给定的一个自然数n,将分母小于等于n的不可约的真分数按升序排列,并且在第一个分数之前加上0/1,在最后一个分数之后加上1/1,这个序列称为n级法雷数列,以Fn表示.如F5为:0/1,1/5, 1 ...
- django 创建model(数据库表)失败
在models.py中创建数据库表 from django.db import models # Create your models here. class Book(models.Model) ...
- Android adb 串口调试
adb (串口输入) echo 1 > /sys/class/remount/need_remount; mount -o rw,remount /system ...
- XML自学笔记
1. xml指可扩展标记语言,(extensible markup language),该语言被设计用来传输和存储数据,HTML被设计用来显示数据 XML标签没有被预定义,需要自定义标签:XML ...
- Ultimate Guide to WeChat for Business 2019
Ultimate Guide to WeChat for Business 2019 By Iaroslav Kudritskiy (source :https://rocketbots.io/blo ...
- Operating Systems (COMP2006)
Operating Systems (COMP2006) 1st Semester 2019Page 1, CRICOS Number: 00301JOperating Systems (COMP20 ...
- Spark入门到精通--(第九节)环境搭建(Hive搭建)
上一节搭建完了Hadoop集群,这一节我们来搭建Hive集群,主要是后面的Spark SQL要用到Hive的环境. Hive下载安装 下载Hive 0.13的软件包,可以在百度网盘进行下载.链接: h ...
- SpringCloud第六步:搭建分布式配置中心
什么是配置中心 在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件.在Spring Cloud中,有分布式配置中心组件spring cloud con ...
- php json 中文不转义 & 转义为中文
JSON_UNESCAPED_UNICODE private function decodeUnicode($str){ return preg_replace_callback('/\\\\u([0 ...
- 2018-2019-2 网络对抗技术 20165236 Exp5 MSF基础应用
2018-2019-2 网络对抗技术 20165236 Exp5 MSF基础应用 一. 实践内容(3.5分) 本实践目标是掌握metasploit的基本应用方式,重点常用的三种攻击方式的思路.具体需要 ...