题意:询问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. Oracle创建dblink进行跨数据库操作

    创建dblink:create public database link link_to_test connect to 用户名 IDENTIFIED by "密码大写" usin ...

  2. 为什么每次打出的包都是Release版本呢?

    参考了:xcodebuild命令 https://www.cnblogs.com/liuluoxing/p/8622108.html 重新打个包,验证一下想法

  3. shell脚本一一项目4

    主题:一键查看服务器使用率 cpu vmstat  suyu wa memery free disk  df -h  /dev tcp连接数 netstat cpu(){ used=$(vmstat ...

  4. 使用eclipse制作war包方法 web项目打包到tomcat

    打开eclipse在左侧右击项目名选择“Export”   在导出画面点击 “Web”->“WAR file”点击“Next”   点击“Browse…”选择文件的导出位置,Target run ...

  5. poj1742Coins(多重背包)

    People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony ...

  6. spring容器、spring MVC容器以及web容器的区别

    本文转载自 https://www.cnblogs.com/xiexin2015/p/9023239.html 说到spring和springmvc,其实有很多工作好多年的人也分不清他们有什么区别,如 ...

  7. Android深度探索-卷1第八章心得体会

    本章介绍了如何将Linux驱动分成多个实现文件和Linux常用的代码重用方式还有些强行卸载Linux驱动的方法 开发一个Linux驱动,可能会在init.exit等函数中发生错误导致Linux驱动安装 ...

  8. HttpUrlConnection工具类

    package com.ligotop.core.utils; import com.ligotop.core.exceptions.BusinessException; import java.io ...

  9. mysql 主从复制 (1)

    Mysql主从配置 大型网站为了软解大量的并发访问,除了在网站实现分布式负载均衡,远远不够.到了数据业务层.数据访问层,如果还是传统的数据结构,或者只是单单靠一台服务器扛,如此多的数据库连接操作,数据 ...

  10. bfs(火星撞地球)

    Meteor Shower 链接:https://ac.nowcoder.com/acm/contest/997/I来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 327 ...