题意:询问n!模1e6+7的结果

n<=1e9

思路:

 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> Pll;
typedef vector<int> VI;
#define N 110000
#define M 1100000
#define fi first
#define se second
#define MP make_pair
#define pi acos(-1)
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define per(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define lowbit(x) x&(-x)
#define Rand (rand()*(1<<16)+rand())
#define id(x) ((x)<=B?(x):m-n/(x)+1)
#define ls p<<1
#define rs p<<1|1 const int MOD=1e6+;
double eps=1e-;
ll INF=1e14; int read()
{
int v=,f=;
char c=getchar();
while(c<||<c) {if(c=='-') f=-; c=getchar();}
while(<=c&&c<=) v=(v<<)+v+v+c-,c=getchar();
return v*f;
} int main()
{
//freopen("1.in","r",stdin);
//freopen("1.out","w",stdout);
int n;
while(scanf("%d",&n)!=EOF)
{
ll ans=;
if(n>=MOD)
{
printf("0\n");
continue;
} rep(i,,n) ans=ans*i%MOD;
printf("%I64d\n",ans);
}
return ;
}

【HDOJ6600】Just Skip The Problem(签到)的更多相关文章

  1. 2019 Multi-University Training Contest 2: 1010 Just Skip The Problem 自闭记

    2019 Multi-University Training Contest 2: 1010 Just Skip The Problem 自闭记 题意 多测.每次给你一个数\(n\),你可以同时问无数 ...

  2. ACM的探索之Just Skip The Problem

    -----------------心怀虔诚,奋勇前进,fighting!!!!!! Problem Description: inclusively:          包括一切地;包含地 simul ...

  3. Just Skip The Problem

    http://acm.hdu.edu.cn/showproblem.php?pid=6600 题意:给你一个数x,允许你多次询问yi,然后回答你x xor yi 是否等于yi,询问尽量少的次数以保证能 ...

  4. hdu多校第二场 1010 (hdu6600)Just Skip This Problem

    题意: 给你一个数x,允许你多次询问yi,然后回答你x xor yi 是否等于yi,询问尽量少的次数以保证能求出xi是几,求出这样询问次数最少的询问方案数. 结果mod1e6+3 题解: 队友赛时很快 ...

  5. [hdu6600]Just Skip The Problem

    1.直接令x=0,为了判断这一信息,对于所有含有多个1的yi,必然是无用的,答案至少为n且不能含有多位1的y2.令yi=2^(i-1),由此发现一定可以得到x每一位的答案,即答案最多为n.因此,发现方 ...

  6. 2019 Multi-University Training Contest 2

    2019 Multi-University Training Contest 2 A. Another Chess Problem B. Beauty Of Unimodal Sequence 题意 ...

  7. CF 1006B Polycarp's Practice【贪心】

    Polycarp is practicing his problem solving skill. He has a list of n problems with difficulties a1,a ...

  8. CodeForces-1006B-Polycarp's Practice

    B. Polycarp's Practice time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  9. Codeforces Round #603 (Div. 2)

    传送门 感觉脑子还是转得太慢了QAQ,一些问题老是想得很慢... A. Sweet Problem 签到. Code /* * Author: heyuhhh * Created Time: 2019 ...

随机推荐

  1. .NET Core:.Net Core 百科

    ylbtech-.NET Core:.Net Core 百科 .NET Core是适用于 windows.linux 和 macos 操作系统的免费.开源托管的计算机软件框架,是微软开发的第一个官方版 ...

  2. 给url添加时间戳,解决浏览器缓存

    //解决浏览器缓存function timestamp(url){ // var getTimestamp=Math.random(); var getTimestamp=new Date().get ...

  3. 配置最漂亮的PyCharm界面,Python程序员必备!

    高逼格超美的IDE界面,是每个程序员的梦想! 随着人工智能/机器学习的兴起,Python作为一门“漂亮的语言”,再次获得广大程序员的关注.而JetBrains出品的PyCharm无疑是最好用的Pyth ...

  4. canvas绘制验证码

    css样式: <style> body{ text-align: center; } canvas{ background:#ddd; } </style> body中添加标签 ...

  5. Scratch可视化的编程工具

    1.是什么? 在线编程网址 是一个编程软件,但是不涉及编程语言,是针对青少年开发的编程积木模块. 2.软件的目的是什么? 激发青少年对编程的兴趣 3.怎么用呢? 软件内部是很多积木模块,需要明白每块是 ...

  6. 001/Nginx高可用模式下的负载均衡与动静分离(笔记)

    Nginx高可用模式下的负载均衡与动静分离 Nginx(engine x)是一个高性能的HTTP和反向代理服务器,具有内存少,并发能力强特点. 1.处理静态文件.索引文件以及自动索引:打开文件描述符缓 ...

  7. Jmeter-后置处理器(Json extractor)

    后置处理器-json extractor 概念:顾名思义,提取json响应的数据中提取数据: 步骤:sampler-后置处理器-jsonextractor 1.提取单个参数 1.Variable na ...

  8. 牛逼哄哄的 API 网关是什么鬼?面试必问!

    Java技术栈 www.javastack.cn 优秀的Java技术公众号 作者:aCoder2013 github.com/aCoder2013/blog/issues/35 前言 假设你正在开发一 ...

  9. Python入门习题8.羊车门问题

    例8. 羊车门问题描述:有3扇关闭的门,一扇后停着汽车,另外两扇门后是山羊,主持人知道每扇门后是什么.参赛者首先选择一扇门.在开启它之前,主持人会从另外两扇门中打开一扇门,露出门后的山羊.此时,允许参 ...

  10. mintUI修改toast样式的问题解决办法

    在公共样式中加入 /*修改mintUI 弹窗样式大小*/ .noticeErrorToast{ transform: scale(2) !important; margin-left:-.6rem ! ...