122972024-12-11 15:47:29iSamu7598Vízpartcpp17Wrong answer 0/1001ms556 KiB
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
ifstream f("stdin");
ofstream g("stdout");

int n, m, i, j, k, x, v[102]={0};
f>>n>>m>>k>>x;

for(i=1; i<=n; i++){
    f>>j;
    v[i]=j;
    f>>j;
    v[i]=v[i]+m*j;
}
k=k*m;
for(i=1; i<=n; i++){
    for(j=1; j<n; j++){
        if(v[j]<=v[j+1])
        swap(v[j], v[j+1]);
    }
}

for(i=1; i<=k; i++){
    v[1]=v[1]-x;
    j=1;
    while(v[j]<v[j+1]&&j<=n){
        swap(v[j], v[j+1]);
    j++;
    }

}
x=v[1];
for(i=2; i<=n; i++){
    if(v[i]>x){
        x=v[i];
    }
}
for(i=1; i<=n; i++){
    cout<<v[i]<<" ";
}
g<<x;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/8
1Wrong answer1ms320 KiB
subtask20/22
1Wrong answer1ms320 KiB
2Wrong answer1ms332 KiB
3Wrong answer1ms500 KiB
4Wrong answer1ms320 KiB
5Wrong answer1ms320 KiB
6Wrong answer1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms320 KiB
subtask30/43
1Wrong answer1ms320 KiB
2Wrong answer1ms320 KiB
3Wrong answer1ms320 KiB
4Wrong answer1ms508 KiB
5Wrong answer1ms352 KiB
6Wrong answer1ms552 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms556 KiB
10Wrong answer1ms372 KiB
subtask40/27
1Wrong answer1ms320 KiB
2Wrong answer1ms408 KiB
3Wrong answer1ms324 KiB
4Wrong answer1ms320 KiB
5Wrong answer1ms320 KiB
6Wrong answer1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms320 KiB
11Wrong answer1ms320 KiB