Submission #782099

# Submission time Handle Problem Language Result Execution time Memory
782099 2023-07-13T15:22:38 Z Matblube Poi (IOI09_poi) C++14
85 / 100
207 ms 39596 KB
#include <iostream>
#include <iomanip>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define dbg(x) cerr<<#x<<": "<<x<<"\n";
#define fr(i, x) for(ll i=0 ; i<x ; i++)
#define fra(x, v) for(auto x:v)
#define fra1(x,v) for(auto &x:v)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define pb(x) push_back(x)
#define F first
#define S second
#define inf 10000000000
#define sz(x) (ll) x.size()

const double PI=acos(-1);
const ll MOD=1e9+7, maxN=100010;

struct uwu{
    ll x ,y, z;
};

ll gcd(ll a, ll b){return (!b)?a:(gcd(b, a%b));}

ll lcm(ll a, ll b){
    if(a>b) swap(a, b);
    return a/gcd(a, b)*b;
}

ll binpow(ll a, ll b){
    ll cc=1;
    while(b){
        if(b&1) cc*=a;
        a*=a;
        b>>=1;
    }
    return cc;
}
ll binpow1(ll a, ll b){
    ll cc=1;
    while(b){
        if(b&1) cc=cc*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return cc%MOD;
}

bool comp(uwu a, uwu b){
    if(a.x==b.x) return a.y>b.y;
    return a.x>b.x;
}

void solve(){
    ll n, m, k, aux; cin>>n>>m>>k;
    vector<ll>score(m);
    vector<uwu>rank(n);
    ll resu[n][m];
    fr(i, n){
        fr(j, m){
            cin>>aux;
            resu[i][j]=aux;
            score[j]+=(aux^1);
            rank[i].y+=aux;
        }
        rank[i].z=i+1;
    }
    fr(i, n){
        fr(j, m){
            if(resu[i][j]) rank[i].x+=score[j];
        }
    }
    sort(all(rank), comp);
    fr(i, n){
        if(rank[i].z==k){
            cout<<rank[i].x<<" ";
            cout<<i+1<<"\n"; return;
        }
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 456 KB Output is correct
10 Correct 3 ms 724 KB Output is correct
11 Correct 6 ms 1384 KB Output is correct
12 Incorrect 13 ms 2296 KB Output isn't correct
13 Correct 38 ms 6116 KB Output is correct
14 Correct 53 ms 8632 KB Output is correct
15 Correct 94 ms 15004 KB Output is correct
16 Correct 100 ms 16116 KB Output is correct
17 Incorrect 150 ms 23728 KB Output isn't correct
18 Correct 160 ms 26876 KB Output is correct
19 Incorrect 184 ms 35580 KB Output isn't correct
20 Correct 207 ms 39596 KB Output is correct