2015 Syrian Private Universities Collegiate Programming Contest(gym101020)
来源:互联网 发布:3dsmax2014软件许可证 编辑:程序博客网 时间:2024/05/01 18:15
Problem A. Window
#include <bits/stdc++.h>#define INF 0x3f3f3f3f#define eps 1e-8typedef long long LL;const double pi = acos(-1.0);const int mod = 1e9 + 7;using namespace std;int main(){ //freopen("int.txt","r",stdin); //freopen("out.txt","w",stdout); LL n,m; int T; cin >> T; while(T--){ cin >> n >> m; cout << n * m << endl; } return 0;}
Problem B. Paper Game
#include <bits/stdc++.h>#define INF 0x3f3f3f3f#define eps 1e-8typedef long long LL;const double pi = acos(-1.0);const int mod = 1e9 + 7;using namespace std;int main(){ //freopen("int.txt","r",stdin); //freopen("out.txt","w",stdout); int n,m; int T; cin >> T; while(T--){ cin >> n >> m; if(n % 2 == 1 && m % 2 == 1) puts("Hussain"); else puts("Hasan"); } return 0;}
Problem C. Rectangles
#include <bits/stdc++.h>#define INF 0x3f3f3f3f#define eps 1e-8typedef long long LL;const double pi = acos(-1.0);const int mod = 1e9 + 7;using namespace std;int a[105];int main(){ //freopen("int.txt","r",stdin); //freopen("out.txt","w",stdout); int T,n,i,j,k; cin >> T; while(T--){ memset(a,0,sizeof(a)); cin >> n; for(int p = 1;p <= n;p++){ cin >> i >> j >> k; for(int l = i + 1;l <= j;l++) a[l] = max(a[l],k); } int ans = 0; for(int h = 1;h <= 100;h++) ans += a[h]; cout << ans << endl; } return 0;}
Problem D. Sequences
题意:给你一个数组,让你找出这个数组中最长的一个序列,这个序列要求满足严格递增,且后一个数比前一个数大1
Problem E. Napol´eon
没太懂题意
Problem F. The Best Strategy
#include <bits/stdc++.h>#define INF 0x3f3f3f3f#define eps 1e-8typedef long long LL;const double pi = acos(-1.0);const int mod = 1e9 + 7;using namespace std;int a[105];int sum[105];int main(){ //freopen("int.txt","r",stdin); //freopen("out.txt","w",stdout); int T,n; cin >> T; int cnt = 0; while(T--){ cin >> n; memset(sum,0,sizeof(sum)); for(int i = 1;i <= n;i++) cin >> a[i]; sort(a + 1,a + n + 1); int time = 0; int solve = 0; for(int i = 1;i <= n;i++) { sum[i] = a[i] + sum[i - 1]; if(sum[i] <= 300){ time += sum[i]; solve++; } else break; } printf("Case %d: %d %d\n",++cnt,solve,time); } return 0;}
Problem J. Good Coins
#include <bits/stdc++.h>#define INF 0x3f3f3f3f#define eps 1e-8typedef long long LL;const double pi = acos(-1.0);const int mod = 1e9 + 7;using namespace std;int gcd(int a,int b){ return !b ? a : gcd(b,a % b);}int main(){ //freopen("int.txt","r",stdin); //freopen("out.txt","w",stdout); int T,i,j; cin >> T; while(T--){ cin >> i >> j; if(gcd(i,j) == 1) puts("GOOD"); else puts("NOT GOOD"); } return 0;}
0 0
- 2015 Syrian Private Universities Collegiate Programming Contest(gym101020)
- GYM 2015 ACM Syrian Collegiate Programming Contest
- 2015 China Collegiate Programming Contest
- 2015 ACM Arabella Collegiate Programming Contest(F题)
- hdu5551Huatuo's Medicine(The 2015 China Collegiate Programming Contest )
- 2015 China Collegiate Programming Contest Nanyang
- AlBaath Collegiate Programming Contest (2015) 总结
- Galactic Collegiate Programming Contest
- 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(2015浙江省赛)
- 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(2015浙江省赛---第三部分)
- hdu5540 Secrete Master Plan(The 2015 China Collegiate Programming Contest )
- 带权并查集:CF-2015 ACM Arabella Collegiate Programming Contest(F题)
- Codeforces Gym 2015 ACM Arabella Collegiate Programming Contest(二月十日训练赛)
- 2015 AlBaath Collegiate Programming Contest(2月14日训练赛)
- Codeforces Gym 2015 ACM Amman Collegiate Programming Contest
- Codeforces Gym 2015 ACM Arabella Collegiate Programming Contest
- 2015 ACM Amman Collegiate Programming Contest 简要题解。
- The 2015 China Collegiate Programming Contest D Pick The Sticks
- IPv6 Router Advertisement Floods (by quqi99)
- GXT 3.1.1 的VBoxLayoutContainer 高度BUG
- POJ 1556 (平面几何 最短路)
- C#的标准容器类
- 超炫的粒子动画库
- 2015 Syrian Private Universities Collegiate Programming Contest(gym101020)
- 构造回文
- linux下离线更新nessus漏洞插件的方法
- 产品上架app store最新流程
- POJ 2262 Goldbach's Conjecture
- 创建对象与使用对象——谈谈工厂的作用
- 剑指offer题解 数组中只出现一次的数字
- Java学习笔记(1)Introduction to Computers, Programs, and Java
- windows编程之进程枚举的三种方式