# poj 2017 Speed Limit

1. 简单题

#include <iostream>
#include <cstring>
using namespace std;

int main()
{
int n, i, ans, t[11], s;
while (cin >> n)
{
if (n == -1)
break;
memset(t, 0, sizeof(t));
ans = 0;
for (i = 1; i <= n; i++)
{
cin >> s >> t[i];
ans += s * (t[i] - t[i-1]);
}
cout << ans << " miles" << endl;
}
return 0;
}


• 本文已收录于以下专栏：

## POJ-2017 Speed Limit-行驶公里数

Speed Limit Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 18170   Accepted: 127...
• MIKASA3
• 2015年08月07日 20:01
• 368

## 【GDOI2017模拟11.5】Dash Speed

Description给出n个点的一棵树，每条边有一个限制区间[l,r]。 给出m次询问，每次询问给出一个数x，求一条最长的所有边都满足l...

## 2017 World Final - need for speed

2017 World Final 解题报告need for speed Sheila is a student and she drives a typical student car: it is ...

## POJ 2501 Average Speed --from lanshui_Yang

Description You have bought a car in order to drive from Waterloo to a big city. The odometer on ...

## 2017-03- 14 POJ highways

DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public hi...

## CSU-ACM2017暑假集训比赛1 TD POJ3111

#include #include #include #define maxl 100010 #define inf 2000000001 #define eps 1e-7 using namesp...

举报原因： 您举报文章：poj 2017 Speed Limit 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)