51Nod 1014 X^2 Mod P
2024-09-01 07:36:21
注意潜在范围 x*x用long long
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i,a,n) for(int i = a; i < n; i++)
#define repe(i,a,n) for(int i = a; i <= n; i++)
#define per(i,n,a) for(int i = n; i >= a; i--)
#define clc(a,b) memset(a,b,sizeof(a))
#define INF 1e18+100
#define N 1000010
typedef long long LL;
int arr[N];
int main()
{
int a,p;
while(~scanf("%d%d",&p,&a)){
int cnt=;
for(int i=;i<=p;i++){
if((LL)i*i%p==a){
arr[cnt++]=i;
}
}
if(cnt==){
puts("No Solution");
continue;
}
sort(arr,arr+cnt);
printf("%d",arr[]);
for(int i=;i<cnt;i++){
printf(" %d",arr[i]);
}
puts("");
}
return ;
}
最新文章
- C#序列化
- Python读取文件内容并将内容插入到SSDB中
- jQuery网页版五子棋小游戏源码下载
- Unix操作系统中UUCP知识详细讲解
- 【转】Ubuntu网卡配置
- C#事件(event)解析
- esp和ebp详解
- Kafka Topic动态迁移 (源代码解析)
- AlphaToCoverage solution
- 浏览器中显示视频,flash等的代码处理
- POJ-3468-A Simple Problem with Integers(区间更新,求和)-splay或线段树
- FTP配置参数
- Unity 的几种打包姿势(android)
- 【转】shell字符串截取
- IDEA中添加javap反编译
- fastext 中文文本分类
- 2019-4-25 html学习笔记
- Shutting down CodePlex 03/31/2017
- LG2945 【[USACO09MAR]沙堡Sand Castle】
- 提示框一段时间以后消失setTimeout