提交记录 6918


用户 题目 状态 得分 用时 内存 语言 代码长度
HigHwind noip18a. 【NOIP2018】铺设道路 Accepted 100 1.417 ms 36 KB C++ 416 B
提交时间 评测时间
2018-11-16 23:36:59 2020-08-01 00:54:12
#include <bits/stdc++.h>
#define gor(A,B,E) for(int A=B;A<=E;++A)
using namespace std;

inline int read() {
	int c,f=1,v=0;while(!isdigit(c=getchar())) if(c=='-')f=-1;
	do v*=10,v+=c-'0'; while(isdigit(c=getchar()));return v;
}

const int N = 1e5+3;

int n, a, mn = 0, ans = 0;

int main() {
	n = read();
	gor(i, 1, n) {
		a = read();
		if (a - mn > 0) ans += a - mn;
		mn = a;
	}
	cout << ans << endl;
	return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #134.6 us36 KBAcceptedScore: 10

Testcase #240.01 us36 KBAcceptedScore: 10

Testcase #336.34 us36 KBAcceptedScore: 10

Testcase #440.73 us36 KBAcceptedScore: 10

Testcase #534.93 us36 KBAcceptedScore: 10

Testcase #638.07 us36 KBAcceptedScore: 10

Testcase #746.23 us36 KBAcceptedScore: 10

Testcase #8156.1 us36 KBAcceptedScore: 10

Testcase #9724.09 us36 KBAcceptedScore: 10

Testcase #101.417 ms36 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:24:57 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠