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的 ...
随机推荐
- python 将list的值赋值给变量
list中有n个值,赋值给k个变量:a1, a2, ……,ak n = k时:a1, a2, ……,ak = list n > k时:使用1式报错:ValueError: too many va ...
- [jzoj]2505.【NOIP2011模拟7.29】藤原妹红
Link https://jzoj.net/senior/#main/show/2505 Description 在幻想乡,藤原妹红是拥有不老不死能力的人类.虽然不喜欢与人们交流,妹红仍然保护着误入迷 ...
- 迭代器&迭代对象&生成器
迭代器 & 迭代对象 & 生成器 包含__next__ 和 __iter__两个方法的对象为迭代器 __next__方法返回单个元素 __iter__方法返回迭代器本身 可迭代对象包含 ...
- JSON WEB Token(JWT)
最近面试被问及单点登陆怎么解决?自己的项目前后端分离,自己实现token认证,token有失效时间,token中包含用户基本的信息.且一个当用户重新登陆后,原来的token就会失效,这么安全的一个to ...
- JAVA 学习日记
4. 数组 int[] in = new int[5];in[0] = 1;in[1] = 11;in[2] = 111;for(int i=0;i<in.length;i++){ System ...
- ECMA Script 6_简单介绍
ECMAScript 6 ECMA 组织 前身是 欧洲计算机制造商协会 指定和发布脚本语言规范,标准在每年的 6 月份正式发布一次,作为当年的正式版本 这样一来,就不需要以前的版本号了,只要用年份标记 ...
- linux学习:wget与lynx用法整理
指令:wget.lynx.axel wget url #下载数据写入文件,下载的文件名与url中的文件名保持一致,下载信息或进度写入stdoutwget url1 url2 url3 #下载多 ...
- sqlserver 常见的表名修改
查看表:exec sp_help 表名 查看列: exec sp_columns 表名 查看列:select * from information_schema.columns where table ...
- 熟悉Linux常用命令
cd命令:切换目录 (1)切换到目录 /usr/localcd / usrcd / local (2)去到目前的上层目录cd .. (3)回到自己的主文件夹cd ls命令:查看文件与目录 (4)查看目 ...
- CentOS7 64位安装mysql教程
参考链接:http://baijiahao.baidu.com/s?id=1597184796823517712&wfr=spider&for=pc https://www.cnblo ...