提交记录 12925


用户 题目 状态 得分 用时 内存 语言 代码长度
lrw04 noip18a. 【NOIP2018】铺设道路 Accepted 100 11.277 ms 428 KB C++11 303 B
提交时间 评测时间
2020-07-04 23:09:58 2020-08-01 03:01:27
#include <bits/stdc++.h>
using namespace std;

#define MAXN 100050
int n, a[MAXN];

int main() {
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
		
	int prev = 0, ans = 0;
	for (int i = 0; i < n; i++) {
		if (a[i] > prev) ans += a[i] - prev;
		prev = a[i];
	}
	
	cout << ans << endl;
	return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #136.71 us40 KBAcceptedScore: 10

Testcase #243.64 us40 KBAcceptedScore: 10

Testcase #338.33 us40 KBAcceptedScore: 10

Testcase #437.44 us40 KBAcceptedScore: 10

Testcase #540.28 us40 KBAcceptedScore: 10

Testcase #660.3 us40 KBAcceptedScore: 10

Testcase #7133.68 us44 KBAcceptedScore: 10

Testcase #81.027 ms80 KBAcceptedScore: 10

Testcase #95.669 ms236 KBAcceptedScore: 10

Testcase #1011.277 ms428 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2020-08-05 15:07:49 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用