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…
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…
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…
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…
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…
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…
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. 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…
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…
  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…
layout: post title: (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest(爽题) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces - DP - 状态压缩 - LCA 传送门 付队! C - Greetings! (状态压缩) 题意 给N种信件,你可以任意选择K种信封装信件,问你最少的浪费是多少 不能大的信件装…
layout: post title: (寒假开黑gym)2017-2018 ACM-ICPC German Collegiate Programming Contest (GCPC 2017) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces 传送门 付队! 许老师! B.Buildings (polya定理) 题意 B:给你m面墙,每面墙是n*n的格子,你有c种颜色,问你有多少种涂色方案.用po…
layout: post title: (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces 传送门 付队! 许老师! Hello SCPC 2018! (签到) #include<bits/stdc++.h> using namespace std; typedef…
$$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\)的情况下,所化的最小时间,最后再从走遍了…
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…
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* 序列中取…
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…
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…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long const int MAXN=1010; int a[MAXN<<1]; int main() { int t; cin>>t; int n; while(t--) { cin>>n; for(int i=1;i<=2*n;i++)…
bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #define ll long long ll a[1000005]; int main() { int t,n,temp; ll ans,maxn,minl,x; scanf("%d",&t); while(t--) { scanf("%I64d",&n);…
bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #define ll long long const ll maxn = 1e5 + 5; const ll mod = 1e9+7; ll n; ll p[maxn]; ll vis[maxn]; int main() { ll t; scanf("%lld",&t); ll pre;…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long int main() { int t; scanf("%d",&t); ll n,m; while(t--) { scanf("%lld%lld",&n,&m); ll cnt=0; if(m>n)swa…