2015 Syrian Private Universities Collegiate Programming Contest(gym101020)

Problem A. Window

#include <bits/stdc++.h>

#define INF 0x3f3f3f3f
#define eps 1e-8

typedef 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-8

typedef 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-8

typedef 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-8

typedef 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-8

typedef 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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值