A (By ggg): 题意:一个人还有x秒到红绿灯,这个红绿灯有g秒绿灯,y秒黄 灯,r秒红灯,问你到红绿灯的时候是什么灯.值得注意的是绿 灯变黄灯时,第g秒是黄灯了. B (By Anxdada): Gym - 100947B C(By Kresnt): 显然,当 n 时偶数的时候,只有 2 种取法(取下标为奇数的,或是取下标为偶数的) 当 n 为奇数时,按照隔一取一的方式遍历序列 Seq A:1 5 3 2 4 遍历为 Seq B:1 3 4 5 2 然后问题就变成了从 *B* 序列中取…
Description Yaaaay, Haven't you heard the news? Bakaloria results are out! And Reem had very good grades. Finally she can go to IT college and pursue her childhood dream of becoming a great programmer. Reem is very excited about her college, she alre…
Description Tamer is traveling with his brother on a long highway. He sees a traffic light at a distance. He calculated that it will take him x seconds until he arrives at the traffic light, he also knows that the green light lasts for g seconds, the…
Secrete Master Plan Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 429    Accepted Submission(s): 244 Problem Description Master Mind KongMing gave Fei Zhang a secrete master plan stashed in a…
Game Rooms Time Limit: 4000/4000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status Your company has just constructed a new skyscraper, but you just noticed a terrible problem: there is only space to put one game room on each…
$$2015\ German\ Collegiate\ Programming\ Contest\ (GCPC 15) + POI 10-T3$$ \(A.\ Journey\ to\ Greece\) 状压DP,TSP,先考虑找出这些关键点之间的最短路,然后就是旅行商问题,其中可以用一次\(taxi\),考虑\(dp\)状态为\(f[i][msk][tag]\),表示当前所在位置为\(i\)点,已经经过的节点集合为\(msk\),是否用过\(taxi\)的情况下,所化的最小时间,最后再从走遍了…
E. Arrange Teams time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output Syrian Collegiate Programming Contest (SCPC) is the qualified round for the Arab Collegiate Programming Contest. Each year S…
F. Contestants Ranking time limit per test:1 second memory limit per test:24 megabytes input:standard input output:standard output Ahmad is one of the best students in HIAST, and also a very good problems Solver. In the time you will spend reading th…
A. Who is the winner? time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output A big marathon is held on Al-Maza Road, Damascus. Runners came from all over the world to run all the way along the road…
  A. Who is the winner?   time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output A big marathon is held on Al-Maza Road, Damascus. Runners came from all over the world to run all the way along the…
  B. New Job   time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output This is the first day for you at your new job and your boss asks you to copy some files from one computer to other computers in…
  C. Palindrome Again !!   time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output Given string with N characters, your task is to transform it to a palindrome string. It's not as easy as you may th…
当时比赛时超时了,那时没学过树状数组,也不知道啥叫离散化(貌似好像现在也不懂).百度百科--离散化,把无限空间中无限的个体映射到有限的空间中去,以此提高算法的时空效率. 这道题是dp题,离散化和树状数组用来优化,状态转移方程:dp[i][j]=sum(dp[i-1][k])----k需要满足a[j]>a[k]&&k<j; i表示所要选的个数,j表示以第a[j]个数结尾所有的符合要求的递增串的个数,最后答案就是sum(dp[n][j])--1<=j<=p;n 为要选的…
Huatuo's Medicine Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 398    Accepted Submission(s): 272 Problem Description Huatuo was a famous doctor. He use identical bottles to carry the medicin…
Game Rooms Time Limit: 4000/4000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 305    Accepted Submission(s): 84 Problem Description Your company has just constructed a new skyscraper, but you just noticed a terrib…
Sudoku Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 596    Accepted Submission(s): 216 Problem Description Yi Sima was one of the best counselors of Cao Cao. He likes to play a funny game him…
Ancient Go Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 577    Accepted Submission(s): 213 Problem Description Yu Zhou likes to play Go with Su Lu. From the historical research, we found that…
Ba Gua Zhen Time Limit: 6000/4000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 304    Accepted Submission(s): 93 Problem Description During the Three-Kingdom period, there was a general named Xun Lu who belonged t…
Pick The Sticks Time Limit: 15000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 593    Accepted Submission(s): 193 Problem Description The story happened long long ago. One day, Cao Cao made a special order c…
The Battle of Chibi Time Limit: 6000/4000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 591    Accepted Submission(s): 192 Problem Description Cao Cao made up a big army and was going to invade the whole South Chin…
J. Polygons Intersection time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output We will not waste your time, it is a straightforward problem. Given multiple polygons, calculate the area of their i…
I. Mancala time limit per test:3 seconds memory limit per test:256 megabytes input:standard input output:standard output Mancala is a traditional board game played in Africa, Middle East and Asia. It is played by two players. This game board consists…
H. Special Palindrome time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output A sequence of positive and non-zero integers called palindromic if it can be read the same forward and backward, for exa…
G. The jar of divisors time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output Alice and Bob play the following game. They choose a number N to play with. The rules are as follows: - They write eac…
D. Time to go back time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output You have been out of Syria for a long time, and you recently decided to come back. You remember that you have M friends th…
C. Palindrome Again !! time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output Given string with N characters, your task is to transform it to a palindrome string. It's not as easy as you may think…
B. New Job time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output This is the first day for you at your new job and your boss asks you to copy some files from one computer to other computers in an…
You have been out of Syria for a long time, and you recently decided to come back. You remember that you have M friends there and since you are a generous man/woman you want to buy a gift for each of them, so you went to a gift store that have N gift…
A sequence of positive and non-zero integers called palindromic if it can be read the same forward and backward, for example: 15 2 6 4 6 2 15 20 3 1 1 3 20 We have a special kind of palindromic sequences, let's call it a special palindrome. A palindr…
D. Time to go back   time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have been out of Syria for a long time, and you recently decided to come back. You remember that you have M friends…