Submission #3969

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
39692013-08-31 09:47:38pmpmpKing of penalty (kriii1_K)C++98
1 / 1
32 ms3240 KiB
#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
/*typedef struct{
int x, y, n, nn;
}tree;
tree h[101];
int hx[101], hy[101];
bool cmp(tree a, tree b){ return a.n>b.n; }*/
bool cmpx(int a, int b){ return a<b; }
long long h[100005], s[100005], sum;
int main ()
{
////// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int a, b, c;
int i, j, k, t;
scanf("%d %d", &a, &b);
for(i=0;i<b;i++){scanf("%lld", &h[i]);}
sort(h,h+b,cmpx); s[0]=h[0];
for(i=1;i<b;i++){s[i]=s[i-1]+h[i];}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...