Codeforces 1182A Filling Shapes
题目链接: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的更多相关文章
- 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 ...
- Codeforces 1290F - Making Shapes(数位 dp)
Codeforces 题面传送门 & 洛谷题面传送门 数位 dp 好题. 首先,由于是凸包,一但向量集合确定,凸包的形态肯定就已经确定了.考虑什么样的向量集合能够组成符合条件的凸包,我们假设第 ...
- Codeforces Round #566 (Div. 2)
Codeforces Round #566 (Div. 2) A Filling Shapes 给定一个 \(3\times n\) 的网格,问使用 这样的占三个格子图形填充满整个网格的方案数 如果 ...
- Codeforces Round #566 (Div. 2)题解
时间\(9.05\)好评 A Filling Shapes 宽度为\(3\),不能横向填 考虑纵向填,长度为\(2\)为一块,填法有两种 如果长度为奇数则显然无解,否则\(2^{n/2}\) B Pl ...
- 图形上下文导论(Introduction to SWT Graphics)zz
图形上下文导论(Introduction to SWT Graphics) 摘要: org.eclipse.swt.graphics包(package),包含了管理图形资源的类.只要实现了org.ec ...
- 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\) ...
- [Codeforces 1228E]Another Filling the Grid (排列组合+容斥原理)
[Codeforces 1228E]Another Filling the Grid (排列组合+容斥原理) 题面 一个\(n \times n\)的格子,每个格子里可以填\([1,k]\)内的整数. ...
- [暴力] 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 ...
- e587. Filling Basic Shapes
There are two ways to fill basic shapes like lines and rectangles. The first is to use specific draw ...
随机推荐
- windows系统使用
1.访问局域网共享的文件,用 \\ip号 2.电脑的硬件名称(设备管理器中)是可以用软件修改的. 3.电脑中每一个连接网络的设备都有一个网卡地址(MAC地址),如无线网卡地址.有线网卡地址. 4.wi ...
- Ext 选项卡面板TabPanel
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 微信小程序无法获取到unionId(专业踩坑20年)
UnionID机制说明如果开发者拥有多个移动应用.网站应用.和公众帐号(包括小程序),可通过unionid来区分用户的唯一性,因为只要是同一个微信开放平台帐号下的移动应用.网站应用和公众帐号(包括小程 ...
- Eclipse lombok get set方法报错
在maven仓库中找到 lombok jar包 如:C:\Program File\.m2\Repository\org\projectlombok\lombok\1.18.2\lombok-1.18 ...
- 机器学习技法笔记:Homework #7 Decision Tree&Random Forest相关习题
原文地址:https://www.jianshu.com/p/7ff6fd6fc99f 问题描述 程序实现 13-15 # coding:utf-8 # decision_tree.py import ...
- Codeforces 1173B Nauuo and Chess
题目链接:http://codeforces.com/problemset/problem/1173/B 思路参考:https://www.cnblogs.com/blowhail/p/1099123 ...
- 前端(五)—— a、img、list标签
a标签.img标签.list标签 一.a标签 1.常用用法 <a href="https://www.baidu.com">前往百度</a> <a h ...
- Lung Nodule Detection------work log
有时候真的不知道自己是怎么走上,模式识别,人工智能的这条路上的.但既然走上了这条路,我就没有理由荒废我所学到的东西.在学校里面研究了很长的时间的肺结节检测,但那都是只限于研究和写论文,现在我想把大家的 ...
- 解压lzma格式的img文件报“Filename has an unknown suffix, skipping”怎么办
1 确认img文件是什么压缩格式 file 文件名 2 报标题错误怎么办? mv initrd.img initrd.img.xz xz -d initrd.img.xz cpio -ivd < ...
- java-day02
数据类型自动转换 要求:数据范围从小到大 数据类型强制类型转换 格式:范围小的数据类型 范围小的变量名 = (范围小的数据类型)原范围大的数据 注意事项: 1.可以会造成数据溢出或者是精度损失. 2. ...