# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28314 | 이제 내가 두목이다~ (#68) | 포도주 시음 (FXCUP2_wine) | C++11 | 0 ms | 2180 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |