# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
28314 | 이제 내가 두목이다~ (#68) | Wine Tasting (FXCUP2_wine) | C++11 | 0 ms | 2180 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <set>
#include <numeric>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <cstring>
#include <queue>
#include <numeric>
#include <iomanip>
#define ll long long
using namespace std;
// for(int p=Set;p;p=(p-1)&Set) 부분집합원소순회
//cout<<fixed<<setprecision(11)<<(double)m/z<<"\n";
int Gcd(int a,int b){
if(b==0)return a;
return Gcd(b,a%b);
} //오버플로우조심
int Lcm(int a,int b){
return (a*b)/Gcd(a,b);
}//오버 플로우 조심
const int MAXN=200001;
long long ans=0;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n,m; cin>>n>>m;
long long before=0;
for(int i=1;i<=n;i++){
ll num; cin>>num;
if(num>before){
ans+=num-before;
before=num;
}
else{
before=num;
}
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |