题目链接:http://codeforces.com/problemset/problem/1182/A


思路:n为奇数时不可能完全填充,ans = 0。发现若要完全填充,每俩列可产生俩种情况,所以为 ans = 2n/2

AC代码:

 #include<bits/stdc++.h>
using namespace std;
long long n,ans;
long long quickPow(long long a,long long b){
int sum=;
while(b){
if(b&) sum=sum*a;
b>>=;
a=a*a;
}
return sum;
}
int main(){
long long n;
cin >> n;
if(n % ) cout << ;
else cout << quickPow(,n/);
return ;
}

Codeforces 1182A Filling Shapes的更多相关文章

  1. Codeforces Round #566 (Div. 2) A. Filling Shapes

    链接: https://codeforces.com/contest/1182/problem/A 题意: You have a given integer n. Find the number of ...

  2. Codeforces 1290F - Making Shapes(数位 dp)

    Codeforces 题面传送门 & 洛谷题面传送门 数位 dp 好题. 首先,由于是凸包,一但向量集合确定,凸包的形态肯定就已经确定了.考虑什么样的向量集合能够组成符合条件的凸包,我们假设第 ...

  3. Codeforces Round #566 (Div. 2)

    Codeforces Round #566 (Div. 2) A Filling Shapes 给定一个 \(3\times n\) 的网格,问使用 这样的占三个格子图形填充满整个网格的方案数 如果 ...

  4. Codeforces Round #566 (Div. 2)题解

    时间\(9.05\)好评 A Filling Shapes 宽度为\(3\),不能横向填 考虑纵向填,长度为\(2\)为一块,填法有两种 如果长度为奇数则显然无解,否则\(2^{n/2}\) B Pl ...

  5. 图形上下文导论(Introduction to SWT Graphics)zz

    图形上下文导论(Introduction to SWT Graphics) 摘要: org.eclipse.swt.graphics包(package),包含了管理图形资源的类.只要实现了org.ec ...

  6. Codeforces Round #589 (Div. 2)-E. Another Filling the Grid-容斥定理

    Codeforces Round #589 (Div. 2)-E. Another Filling the Grid-容斥定理 [Problem Description] 在\(n\times n\) ...

  7. [Codeforces 1228E]Another Filling the Grid (排列组合+容斥原理)

    [Codeforces 1228E]Another Filling the Grid (排列组合+容斥原理) 题面 一个\(n \times n\)的格子,每个格子里可以填\([1,k]\)内的整数. ...

  8. [暴力] Educational Codeforces Round 71 (Rated for Div. 2) B. Square Filling (1207B)

    题目:http://codeforces.com/contest/1207/problem/B   B. Square Filling time limit per test 1 second mem ...

  9. e587. Filling Basic Shapes

    There are two ways to fill basic shapes like lines and rectangles. The first is to use specific draw ...

随机推荐

  1. Arduino与NodeMCU——联网

    我们现在要使用Arduino IDE来配置您的ESP8266芯片.这是使用该芯片的好方法,因为您可以使用着名的Arduino IDE对其进行编程,并重复使用几个现有的Arduino库.如果尚未完成,请 ...

  2. python正则re

    import reline = "Catsaresmarterthandogs"matchObj = re.match( r'(.*)are(\w{2})(.*)', line, ...

  3. 测试常用——linux 基础命令

    测试常用 的 linux 基础命令 1,查看服务器日志vi 查看文件(查找关键字:exception/exception  :  从上往下找,按n查找下一个关键字,按shift+n查找上一个关键字?e ...

  4. 7. Jmeter-逻辑控制器介绍与使用

    逻辑控制器介绍与使用 如果(if)控制器 事物控制器 循环控制器 while controller critical section controller foreach控制器 include con ...

  5. 在Windows上安装部署Cuckoo

    1. Cuckoo使用的第三方工具及库 Yara:http://plusvic.github.io/yara/ Pydeep:https://github.com/kbandla/pydeep Yar ...

  6. 1022 Digital Library (30 分)

    1022 Digital Library (30 分)   A Digital Library contains millions of books, stored according to thei ...

  7. C# WinForm 第一个项目控件使用心得

    1.控件心得 1.1 基础控件 panel 作用:布局 难点:重绘边框改变颜色 重绘panel里如果有fill填充控件 panle的padding要改个值 private void pnlPaintB ...

  8. hdu6321 /// 状压DP

    题目大意: 将一个 顶点不重复的边 的边集称为图中的matching 在一个n个点的零图中进行m次操作 + u v为在u v之间加一条边 存在重边 - u v为去掉u v之间的一条边 每次操作后 输出 ...

  9. Unity中调用Windows窗口句柄以及根据需求设置并且解决扩展屏窗体显示错乱/位置错误的Bug

    问题背景: 现在在搞PC端应用开发,我们开发中需要调用系统的窗口以及需要最大化最小化,缩放窗口拖拽窗口,以及设置窗口位置,去边框等功能 解决根据: 使用user32.dll解决 具体功能: Unity ...

  10. gulp+sass+react前端开发,环境搭建

    由于前端技术的发展与市场需求的提高,前端开发已经不仅仅是写几个页面那么简单.如何有效的开发.管理一个越来越庞大.越来越复杂的前端项目,成为互联网团队必须要面对的难题. 各种js库.ui库曾经火极一时. ...