注意潜在范围 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 ;
}

最新文章

  1. C#序列化
  2. Python读取文件内容并将内容插入到SSDB中
  3. jQuery网页版五子棋小游戏源码下载
  4. Unix操作系统中UUCP知识详细讲解
  5. 【转】Ubuntu网卡配置
  6. C#事件(event)解析
  7. esp和ebp详解
  8. Kafka Topic动态迁移 (源代码解析)
  9. AlphaToCoverage solution
  10. 浏览器中显示视频,flash等的代码处理
  11. POJ-3468-A Simple Problem with Integers(区间更新,求和)-splay或线段树
  12. FTP配置参数
  13. Unity 的几种打包姿势(android)
  14. 【转】shell字符串截取
  15. IDEA中添加javap反编译
  16. fastext 中文文本分类
  17. 2019-4-25 html学习笔记
  18. Shutting down CodePlex 03/31/2017
  19. LG2945 【[USACO09MAR]沙堡Sand Castle】
  20. 提示框一段时间以后消失setTimeout

热门文章

  1. Cortex-M3(NXP LPC 1788) 启动代码
  2. HDU 3062 Party(2-SAT模版题)
  3. Linux中常用的关机和重新启动命令
  4. PHP 5.6.32 增加pdo_dblib.so拓展
  5. RabbitMQ基本模式
  6. windows下cudnn的安装过程
  7. 菜鸟的飞翔日记-os篇
  8. ZOJ 1539 L-Lot
  9. Python的压缩文件处理 zipfile &amp; tarfile
  10. 第四部分shell编程5项目二分发系统