122952024-12-11 15:42:30iSamu7598Vízpartcpp17Wrong answer 0/1001ms576 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];
    }
}
g<<x;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/8
1Wrong answer1ms320 KiB
subtask20/22
1Wrong answer1ms320 KiB
2Wrong answer1ms320 KiB
3Wrong answer1ms336 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 answer1ms320 KiB
5Wrong answer1ms336 KiB
6Wrong answer1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms576 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms320 KiB
subtask40/27
1Wrong answer1ms320 KiB
2Wrong answer1ms320 KiB
3Wrong answer1ms508 KiB
4Wrong answer1ms320 KiB
5Wrong answer1ms320 KiB
6Wrong answer1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms320 KiB
11Wrong answer1ms392 KiB