2015 United Kingdom and Ireland Programming Contest (UKIEPC 2015)

2015年的icpc英国站,不到一百只过题队伍,可以算是icpc在英国刚起步的时候。

Problem B Mountain Biking

思路:作为本场的签到题,读懂题意之后,这题倒是更像一道数学题。给定n个坡面的角度,求解到达坡道底端的速度

利用经典力学动力学公式

v^{2} = v_{0}^{^{2}} + 2 * g * cos(\frac{\pi *\theta }{180}) * D

即可直接求出.

/*
Author Owen_Q
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e7+5;

const double pi = 3.1415926;
int a[maxn];

int main()
{
    int n;
    //freopen(".txt","r",stdin);
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    //cout << cos(60.0/180.0*pi) << endl;
    double g,x[5],a[5],v0=0.0,re[5];
    scanf("%d%lf",&n,&g);
    for(int i=0;i<n;i++)    scanf("%lf%lf",&x[i],&a[i]);
    for(int i=n-1;i>=0;i--)
    {
        double dv2 = 2.0 * g * cos(pi*a[i]/180.0) * x[i];
        double v2 = v0 + dv2;
        re[i] = sqrt(v2);
        v0 = v2;
    }
    for(int i=0;i<n;i++)
        printf("%.7lf\n",re[i]);
    return 0;
}

Problem C Conversation Log

思路:字符串处理的题目,统计用户发送的单词,记录所有用户均发送过的单词,并排序。毫无疑问,事先构造两个表,来存储姓名和单词。之后模拟聊天过程,记录每个用户发送的单词,最后检验单词是否被每个用户都发送过,排序后,在对照反向单词表将单词复原打印

/*
Author Owen_Q
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e4;

map <string,int> nametable;
map <string,int> wordtable;

string findword[maxn];

int record[maxn][maxn];

typedef struct result
{
    int rk;
    string me;
}Result;

bool cmp(const Result &a, const Result &b)
{
    if(a.rk>b.rk)
        return true;
    else if(a.rk==b.rk&&a.me<b.me)
        return true;
    else
        return false;
}

vector<Result> r;

int main()
{
    int n;
    //freopen("in.txt","r",stdin);
    //ios::s
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值