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 ...
随机推荐
- JVM典型配置和调优举例
1. 堆设置-Xms: :初始堆大小.-Xmx: :最大堆大小.-XX:NewSize=n: :设置年轻代大小.-XX:NewRatio=n: : :设置年轻代和年老代的比值.如:为 3,表示年轻代与 ...
- Arduino与无源蜂鸣器
1.Arduino无源蜂鸣器传感器模块 我们可以使用Arduino进行很多互动作品,其中最常用的是声光显示器.之前的所有实验都与LED有关.但是,这个实验中的电路可以产生声音.通常,实验是通过蜂鸣器或 ...
- Golang 标准库提供的Log(一)
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://gotaly.blog.51cto.com/8861157/1405754 G ...
- go gin
1.安装 go get -u github.com/gin-gonic/gin 2. package main import "github.com/gin-gonic/gin" ...
- Bootstrap-table 使用总结 转载https://www.cnblogs.com/laowangc/p/8875526.html
一.什么是Bootstrap-table? 在业务系统开发中,对表格记录的查询.分页.排序等处理是非常常见的,在Web开发中,可以采用很多功能强大的插件来满足要求,且能极大的提高开发效率,本随笔介绍这 ...
- C++——数据类型选择
1.数据类型选择推荐 2.数据类型相关代码注意 2.1 循环的int型注意是int 还是unsigned unsigned a=-1;(a=4294967295)
- jQuery 事件委派
/******************************************************************/ $(function(){ //live()事件委派,后续添加 ...
- JDK8新特性之重复注解
什么是重复注解 下面是JDK8中的重复注解(java.lang.annotation.Repeatable)定义的源码. @Documented @Retention(RetentionPolicy. ...
- Android四大组件之Service浅见
Service 是Android四大组件之一,可以在不显示界面的情况下在后台运行.还有一个作用是通过AIDL来实现进程间通信. Service的启动方式 Service的启动方式有两种,startSe ...
- VS2013 蛋疼的“AJAX Control Toolkit”安装过程
1.AJAX Control Toolkit 下载问题 方法一. 在vs2013中 工具->NuGet程序包管理器->管理解决方案的NuGet程序包 搜索 ajax z找到 AjaxCon ...