ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room(水)
樣例輸入
1 1 2
1 1 4
1 1 1
樣例輸出
Yes
Yes
No
題意:a*b*c的立方體,問能不能用1*1*2的立方體不重疊的放滿
思路:膽子放大,猜完就交,abc三遍任意一邊能被2整除,就可以做到不重疊放滿
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<iostream> #include<vector> #include<queue> #define maxn 300005 using namespace std; int main(){ int a,b,c; while(~scanf("%d%d%d",&a,&b,&c)){ if(c%2==0)printf("Yes\n"); else if(a%2==0)printf("Yes\n"); else if(b%2==0)printf("Yes\n"); else printf("No\n"); } return 0; }
相關推薦
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room(水)
樣例輸入 1 1 2 1 1 4 1 1 1 樣例輸出 Yes Yes No 題意:a*b*c的立方體,問能不能用1*1*2的立方體不重疊的放滿 思路:膽子放大,猜完就交,abc三遍任意
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room
題解 題目大意 給你一定空間 問你能不能用1*1*2的矩形填滿 所給空間只要有一個能被二整除則可以 AC程式碼 #include <stdio.h> #include <bits/stdc++.h> using names
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room
Bob is a sorcerer. He lives in a cuboid room which has a length of AA, a width of BB and a height of CC, so we represent it as AA * BB *
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room
題目大意:有一個a*b*c大小的長方體,你用1*1*2大小的長方體來填充,問是否可以剛好填充。 題解:用大小為1*1*2的長方體來填充,那麼用1*1作底面一定能把底面鋪滿,那麼高的話,需要是2的倍數
ACM-ICPC 2018 焦作賽區網路預賽 H. String and Times (字尾自動機&字尾陣列)
Now you have a string consists of uppercase letters, two integers AA and BB. We call a substring wonderful substring when the times it app
ACM-ICPC 2018 焦作賽區網路預賽L. Poor God Water(矩陣快速冪)
//您們的杜教BM模板。不知道會不會被我們查重全部卡下去。重複率都是百分百。 //但是真好用 //真香 #include <cstdio> #include <cstring> #include <cmath> #include
ACM-ICPC 2018 焦作賽區網路預賽 L. Poor God Water(BM/矩陣快速冪)
通過本題,學到了一個非常NB的黑科技,杜教BM線性遞推模板 直接打表打出前幾項,丟入BM模板就過了,非常神奇,非常強大 網上說BM板子一般8個以上就穩了,賽後試了一下,這個題要丟入前10個數據才能AC。 #include <cstdio> #includ
I. Save the Room(ACM-ICPC 2018 焦作賽區網路預賽)
Bob is a sorcerer. He lives in a cuboid room which has a length of AA, a width of BB and a height of CC, so we represent it as AA * BB * C
L. Poor God Water(ACM-ICPC 2018 焦作賽區網路預賽 快速矩陣冪)
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poi
【多重揹包+二進位制優化】ACM-ICPC 2018 焦作賽區網路預賽 - K. Transport Ship
題目連結<https://nanti.jisuanke.com/t/31720> 題意: 給出若干個船,每個船都有的容量,和的數量。有Q次詢問,給出一定體積的貨物,問你恰好裝滿的方案數量。 題解: 很明顯的多重揹包,但是要加上二進位制優化。 所謂二進位制優
【dp】ACM-ICPC 2018 焦作賽區網路預賽 - B - Mathematical Curse
題目連結<https://nanti.jisuanke.com/t/31711> 題意: 有n個數,m個加減乘除的運算子。按順序取出m個數,進行對應的運算子操作。給你一個初始值,問能構成的最大結果是多少。 題解: 考慮只有加減這兩種運算子的情況,那麼可以想到一
ACM-ICPC 2018 徐州賽區網路預賽 I
Characters with Hash Mur loves hash algorithm, and he sometimes encrypt another one's name, and call him with that encrypted value. For instance, he
ACM-ICPC 2018 焦作賽區網路預賽--A. Magic Mirror
描述 Jessie has a magic mirror. Every morning she will ask the mirror: ‘Mirror mirror tell me, who is the most beautiful girl in the world?’ I
ACM-ICPC 2018 焦作賽區網路預賽 H. String and Times(字尾自動機)
題目連結 題意: 求原串S中出現次數在[A,B]之間的子串的個數 解析: 字尾自動機的經典應用。 我是通過結合了求不同子串個數的d[]和不同子串出現次數的sz[]來做的。 在拓撲序遍歷字尾自動機的時候,我們求不同子串個數是預設d[]初始為1 的,因為預設一個狀態點本身也是
ACM-ICPC 2018 焦作賽區網路預賽 F. Modular Production Line(最小費用流)
題目連結 題意: 給你n個點,每一個點最多被用k次,每一次任務需要同時使用連續編號的若干個點,任務完成相應獲得價值, 並且所使用的點的使用次數-1,問你最大的價值多少 解析: 想了一個下午,想不出怎麼建圖,甚至懷疑是不是用最小費用流做的,後來晚上靈光一現。
ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror
題解 題目大意 忽略大小寫判斷字串是否出現過 直接將字串轉換為全小寫判斷 AC程式碼 #include <stdio.h> #include <bits/stdc++.h> using namespace std; typed
ACM-ICPC 2018 焦作賽區網路預賽 G. Give Candies
題解 題目大意 按照順序分糖果 每個最少分1個 問有多少種情況 根據題意找到規律 答案為2的n-1次方 使用尤拉降冪和快速冪計算 AC程式碼 #include <stdio.h> #include <bits/stdc++.h>
ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror
Every morning she will ask the mirror: 'Mirror mirror tell me, who is the most beautiful girl in the world?' If the mirror says her name,
ACM-ICPC 2018 焦作賽區網路預賽 G. Give Candies 打表+指數迴圈節 or尤拉降冪 一題多解
部落格目錄 原題 傳送門 26.61% 1000ms 65536K There are NN children in kindergarten. Miss Li bought them NN candies. To make the process mor
ACM-ICPC 2018 焦作賽區網路預賽 B. Mathematical Curse 動態規劃
部落格目錄 原題 題目傳送門 22.08% 1000ms 65536K A prince of the Science Continent was imprisoned in a castle because of his contempt for m