ACM的探索之Just Skip The Problem
-----------------心怀虔诚,奋勇前进,fighting!!!!!!
Problem Description:

inclusively: 包括一切地;包含地
simultaneously: 同时
index number : 指数; 索引编号
if and only if: 当且仅当
-----Rough Translation:

Input:

Output:
For each test case, output one line containing an integer denoting the answer.

-------------------------------一会儿再来补充,我要变得更强丫!
分析:
最优的方案必然是每次询问一个位的具体值,一共有n个二进制位,方案数显然是n!。
复杂度O(min(n,P),P=1e6+3)
我的同学写的一个版本:
#include<cstdio>
#define LL long long const int mod = 1e6+;
int main()
{
LL n;
while(~scanf("%lld",&n))
{
if(n >= mod) puts("");//此处mod可以改为41,因为之前已经有个数可以整除
else { // 2009,7*7*41=2009;
LL ans = ;
for(int i = n; i>; i--) {
ans = (ans*(i%mod))%mod;//ans=(ans%mod*i%mod)%mod;
}
printf("%lld\n",ans);
} }
return ;
}
ACM的探索之Just Skip The Problem的更多相关文章
- 2019 Multi-University Training Contest 2: 1010 Just Skip The Problem 自闭记
2019 Multi-University Training Contest 2: 1010 Just Skip The Problem 自闭记 题意 多测.每次给你一个数\(n\),你可以同时问无数 ...
- 哈尔滨工程大学ACM预热赛 G题 A hard problem(数位dp)
链接:https://ac.nowcoder.com/acm/contest/554/G Now we have a function f(x): int f ( int x ) { if ( ...
- ACM学习历程—HDU 5443 The Water Problem(RMQ)(2015长春网赛1007题)
Problem Description In Land waterless, water is a very limited resource. People always fight for the ...
- ACM学习历程—SNNUOJ 1116 A Simple Problem(递推 && 逆元 && 组合数学 && 快速幂)(2015陕西省大学生程序设计竞赛K题)
Description Assuming a finite – radius “ball” which is on an N dimension is cut with a “knife” of N- ...
- ACM程序设计选修课——1041: XX's easy problem(神烦的多次字符串重定向处理)
1041: XX's easy problem Time Limit: 1 Sec Memory Limit: 128 MB Submit: 41 Solved: 7 [Submit][Statu ...
- Just Skip The Problem
http://acm.hdu.edu.cn/showproblem.php?pid=6600 题意:给你一个数x,允许你多次询问yi,然后回答你x xor yi 是否等于yi,询问尽量少的次数以保证能 ...
- ACM的探索之Everything is Generated In Equal Probability! 后序补充丫!
Problem Desciption: 百度翻译后的汉化: 参见博客:https://www.cnblogs.com/zxcoder/p/11253099.html https://blog.csdn ...
- 【Henu ACM Round #13 D】A Trivial Problem
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 123...n中末尾0的个数 只会由素因子2和5的个数决定且等于 Min{cnt[2],cnt[5]} 且素因子2的个数一定会比5多 ...
- 【HDOJ6600】Just Skip The Problem(签到)
题意:询问n!模1e6+7的结果 n<=1e9 思路: #include<bits/stdc++.h> using namespace std; typedef long long ...
随机推荐
- linux - mysql - 卸载:RPM包安装方式的MySQL卸载
(1)检查是否安装了MySQL组件 [root@DB-Server init.d]# rpm -qa | grep -i mysql MySQL-devel-5.6.23-1.linux_glibc2 ...
- Ora-00906:missing left parenthesis
问题描述 Ora-00906:missing left parenthesis 问题原因 varchar和varchar2 必须指定长度,不然会报错
- 洛谷P1170 兔八哥与猎人 欧拉函数的应用
https://www.luogu.org/problem/P1170 #include<bits/stdc++.h> using namespace std; ],b[],c[],d[] ...
- 2019牛客训练赛第七场 C Governing sand 权值线段树+贪心
Governing sand 题意 森林里有m种树木,每种树木有一定高度,并且砍掉他要消耗一定的代价,问消耗最少多少代价可以使得森林中最高的树木大于所有树的一半 分析 复杂度分析:n 1e5种树木,并 ...
- 训练20191009 2018-2019 ACM-ICPC, Asia East Continent Finals
2018-2019 ACM-ICPC, Asia East Continent Finals 总体情况 本次训练共3小时20分钟,通过题数4. 解题报告 D. Deja vu of - Go Play ...
- LitElement(二)模板编写基本语法
原文:https://lit-element.polymer-project.org/guide/templates 1.定义一个渲染模板 1.1 基本规则 要用LitElement 组件定义一个模板 ...
- npm解决node-sass安装失败
npm装包一直都很成功,直到我遇见了node-sass这个包 我一直报这样的错误 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sas ...
- C++-POJ1017-Packets
贪心算法,思路见代码 本来想搜索,结果有O(1)的算法,我佛了 其实每一种6x6的方案可以打表预处理,然后dp or search 但是既然可以贪心何乐而不为呢? #include <set&g ...
- python下matplotlib、numpy、pandas联合作图逐步深入分析
1.代码1: from pandas import Series,DataFrame from numpy.random import randn import numpy as np import ...
- NOIP做题练习(day5)
A - 中位数图 题面 题解 先找出题意中的\(b\)所在的位置. 再以这个位置为中心,向右\(for\)一遍有多少个大于/小于该数的数 大于就\(++cs\) 小于就\(--cs\). 因为这个数是 ...