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 ...
随机推荐
- AspxDashboardView 更新参数
AspxDashboardView 更新参数 function SetThrendDashboardView() { console.log("就是这样被你征服"); var to ...
- PP: Triple-shapelet networks for time series classification
Problem: time series classification shapelet-based method: two issues 1. for multi-class imbalanced ...
- WebService 之 SoapHeader
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- Alan Walker MV 合辑01 by defender 歌词
其实是歌词浏览,配套Alan Walker MV 合辑01 by defender You were the shadow to my life Did you feel us Another sta ...
- render(七)
Vue 的 _render 方法是实例的一个私有方法,它用来把实例渲染成一个虚拟 Node.它的定义在 src/core/instance/render.js 文件中: Vue.prototype._ ...
- 部署Discuz和wordoress
安装discuz 直接把安装包拷贝到根目录下 然后在浏览器中输入http://localhost/myweb/install/index.php 打开安装向导界面,需要修改一下myweb的权限 安全属 ...
- Oracle客户端安装及下载地址
一.下载 http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win64soft-094461 ...
- 从原理到方案,一步步讲解web移动端实现自适应等比缩放
前言 在移动端做自适应,我们常用的有媒体查询,rem ,em,宽度百分比这几种方案.但是都各有其缺点. 首先拿媒体查询来说,在某一个宽度区间内只能使用一种样式,为了适应不同屏幕要,css的代码量就会增 ...
- 题解【洛谷P2002】消息扩散
题面 题解 \(Tarjan\)裸题. \(Tarjan\)缩点后统计入度为\(0\)的强连通分量个数,输出即可. 代码 #include <iostream> #include < ...
- MyEcplise中编码格式的修改问题
1.如果是在Run Configurations中修改编码格式的话,只能是修改当前java文件的编码格式,把改文件中的代码复制到 另一新建 的java文件中会出现异常,所以就会出现相同的代码在两个不同 ...