Codeforces Round #439 (Div. 2) A B C
强哉qls,这场div2竟是其出的!!!
A. The Artful Expedient
暴力 ^ ,判断是否出现,有大佬根据亦或的性质推出 Karen 必赢,太强啦23333333333333.
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <string>
#include <ctype.h>
//******************************************************
#define lrt (rt*2)
#define rrt (rt*2+1)
#define LL long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
//***************************************************
#define eps 1e-8
#define inf 0x3f3f3f3f
#define INF 2e18
#define LL long long
#define ULL unsigned long long
#define PI acos(-1.0)
#define pb push_back
#define mk make_pair #define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SQR(a) ((a)*(a))
#define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))
#define Iterator(a) __typeof__(a.begin())
#define rIterator(a) __typeof__(a.rbegin())
#define FastRead ios_base::sync_with_stdio(0);cin.tie(0)
#define CasePrint pc('C'); pc('a'); pc('s'); pc('e'); pc(' '); write(qq++,false); pc(':'); pc(' ')
#define vi vector <int>
#define vL vector <LL>
#define For(I,A,B) for(int I = (A); I < (B); ++I)
#define rFor(I,A,B) for(int I = (A); I >= (B); --I)
#define Rep(I,N) For(I,0,N)
using namespace std;
const int maxn=+;
int a[maxn],b[maxn],c[maxn*maxn];
int main()
{
int n;
while(cin>>n)
{
Rep(i,n)
{
cin>>a[i];
c[a[i]]=;
}
Rep(i,n)
{
cin>>b[i];
c[b[i]]=;
}
int ans=;
Rep(i,n)
{
Rep(j,n)
{
if( c[ a[i]^b[j]] ) ans++;
}
}
if(ans%) puts("Koyomi");
else puts("Karen");
}
return ;
}
B - The Eternal Immortality
查看 m!/n! 最后一位,水题,没啥好讲的
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <string>
#include <ctype.h>
//******************************************************
#define lrt (rt*2)
#define rrt (rt*2+1)
#define LL long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
//***************************************************
#define eps 1e-8
#define inf 0x3f3f3f3f
#define INF 2e18
#define LL long long
#define ULL unsigned long long
#define PI acos(-1.0)
#define pb push_back
#define mk make_pair #define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SQR(a) ((a)*(a))
#define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))
#define Iterator(a) __typeof__(a.begin())
#define rIterator(a) __typeof__(a.rbegin())
#define FastRead ios_base::sync_with_stdio(0);cin.tie(0)
#define CasePrint pc('C'); pc('a'); pc('s'); pc('e'); pc(' '); write(qq++,false); pc(':'); pc(' ')
#define vi vector <int>
#define vL vector <LL>
#define For(I,A,B) for(int I = (A); I < (B); ++I)
#define rFor(I,A,B) for(int I = (A); I >= (B); --I)
#define Rep(I,N) For(I,0,N)
#define REP(I,N) For(I,1,N+1)
using namespace std;
const int maxn=+;
int main()
{
LL a,b;
while(cin>>a>>b)
{
LL sum=;
for(LL i=a+;i<=b;i++)
{
if(i%==)
{
sum=;
break;
}
else
sum=sum*i%;
}
cout<<sum<<endl;
}
return ;
}
C - The Intriguing Obsession
一道组合数学题,问了初三认识的某数学网友得到的思路23333,用记忆化搜索写的
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <string>
#include <ctype.h>
//******************************************************
#define lrt (rt*2)
#define rrt (rt*2+1)
#define LL long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
//***************************************************
#define eps 1e-8
#define inf 0x3f3f3f3f
#define INF 2e18
#define LL long long
#define ULL unsigned long long
#define PI acos(-1.0)
#define pb push_back
#define mk make_pair #define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SQR(a) ((a)*(a))
#define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))
#define Iterator(a) __typeof__(a.begin())
#define rIterator(a) __typeof__(a.rbegin())
#define FastRead ios_base::sync_with_stdio(0);cin.tie(0)
#define CasePrint pc('C'); pc('a'); pc('s'); pc('e'); pc(' '); write(qq++,false); pc(':'); pc(' ')
#define vi vector <int>
#define vL vector <LL>
#define For(I,A,B) for(int I = (A); I < (B); ++I)
#define rFor(I,A,B) for(int I = (A); I >= (B); --I)
#define Rep(I,N) For(I,0,N)
#define REP(I,N) For(I,1,N+1)
using namespace std;
const int maxn=+;
#define mod 998244353
LL dp[maxn][maxn];
int dir[][]= { {,},{-,},{,},{,-} }; int solve(int x,int y)
{
if(x==||y==)
return ;
if (dp[x][y] == )
{
dp[x][y]=(y*1ll*solve(x-,y-)+solve(x-,y))%mod;
} return dp[x][y];
} int main()
{
int a,b,c;
while(cin>>a>>b>>c)
{
printf("%I64d\n",solve(a,b)*1ll*solve(b,c)%mod*solve(a,c)%mod);
} return ;
}
Codeforces Round #439 (Div. 2) A B C的更多相关文章
- Codeforces Round #439 (Div. 2)【A、B、C、E】
Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> in ...
- Codeforces Round #439 (Div. 2) 题解
题目链接 Round 439 div2 就做了两道题TAT 开场看C题就不会 然后想了好久才想到. 三种颜色挑出两种算方案数其实是独立的,于是就可以乘起来了. E题想了一会有了思路,然后YY出了一种 ...
- Codeforces Round #439 (Div. 2) Problem E (Codeforces 869E) - 暴力 - 随机化 - 二维树状数组 - 差分
Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around ...
- Codeforces Round #439 (Div. 2) Problem C (Codeforces 869C) - 组合数学
— This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii ...
- Codeforces Round #439 (Div. 2) Problem B (Codeforces 869B)
Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense ...
- Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...
- Codeforces Round #439 (Div. 2)
A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...
- 「日常训练」The Intriguing Obsession(CodeForces Round #439 Div.2 C)
2018年11月30日更新,补充了一些思考. 题意(CodeForces 869C) 三堆点,每堆一种颜色:连接的要求是同色不能相邻或距离必须至少3.问对整个图有几种连接方法,对一个数取模. 解析 要 ...
- Codeforces Round #439 (Div. 2) E. The Untended Antiquity
E. The Untended Antiquity 题目链接http://codeforces.com/contest/869/problem/E 解题心得: 1.1,x1,y1,x2,y2 以(x1 ...
- Codeforces Round #439 (Div. 2) C. The Intriguing Obsession
C. The Intriguing Obsession 题目链接http://codeforces.com/contest/869/problem/C 解题心得: 1.由于题目中限制了两个相同 ...
随机推荐
- [Selenium]对弹出的Alert窗口进行操作
Alert alert = driver.switchTo().alert(); alert.accept();
- Java数据结构和算法(四)赫夫曼树
Java数据结构和算法(四)赫夫曼树 数据结构与算法目录(https://www.cnblogs.com/binarylei/p/10115867.html) 赫夫曼树又称为最优二叉树,赫夫曼树的一个 ...
- Java 8 接口中的默认方法与静态方法
Java 8 接口中的默认方法与静态方法 1. 接口中的默认方法 允许接口中包含具有具体实现的方法,该方法称"默认方法",默认方法使用用 default 关键字修饰. public ...
- html5移动开发。
禁止滚动 $('#idl').bind("touchmove",function(e){ e.preventDefault(); }); 图片居中 (因为图片比较特别,所以需要在外 ...
- ejb 和pojo , jboss 和 tomcat
EJB(企业JavaBeans)是普通JavaBeans的一种提升和规范,因为企业信息系统开发中需要一个可伸缩的性能和事务.安全机制,这样能保证企业系统平滑发展,而不是发展到一种规模重新更换一套软件系 ...
- 2018.09.27 网络协议(tarjan)
描述 一些学校连接在一个计算机网络上.学校之间存在软件支援协议.每个学校都有它应支援的学校名单(学校 a 支援学校 b ,并不表示学校 b 一定支援学校 a ).当某校获得一个新软件时,无论是直接得到 ...
- arduino 驱动电调
#include <TimerOne.h> #define PPMPIN 7 ; //0-9 ; void setup() { // put your setup code here, t ...
- Netty学习第二节Java IO通信
一.Java IO通信 名词解释: BIO通信: 采用BIO通信模型的服务端,通常由一个独立的Acceptor线程负责监听客户端连接,在接收到客户端请求后,为每一个客户端建立一个新的线程负 ...
- DataFrame按行读取:DataFrame之values
http://blog.csdn.net/u014607457/article/details/51290582 def fill_core(self): RatingTable=pd.read_cs ...
- 5) mvn archetype:generate
获取帮助 mvn -h 命令格式 usage: mvn [options] [<goal(s)>] [<phase(s)>] -D,--define <arg> D ...