# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
558760 | karon | Poi (IOI09_poi) | C++14 | 250 ms | 23900 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 <bits/stdc++.h>
// #include "laugh.h"
#define pb push_back
#define rs resize
#define debug printf("Hello\n")
#define Pi 3.141592653589793
#define sz(a) ll((a).size())
#define all(x) (x).begin(), (x).end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define mp make_pair
#define f first
#define s second
#define vt vector
#define rst(a,b) memset((a),(b), sizeof(a))
#define FOR(a, b, c) for (ll a = (b); (a) < (c); ++(a))
#define FORE(a, b, c) for (ll a = (b); (a) <= (c); ++(a))
#define FORR(a, b, c) for (ll a = (b); (a) >= (c); --(a))
#define umap unordered_map
#define len(a) (a).length()
#define pqueue priority_queue
using namespace std;
using vi = vector<int>;
using ui = unsigned int;
using ll = long long;
using pll = pair<ll,ll>;
using vll = vector<ll>;
using ull = unsigned long long;
using pii = pair<int, int>;
bool cmp(const vt<int> &a, const vt<int> &b){
if(a[0] != b[0])return a[0]>b[0];
if(a[1] != b[1])return a[1]>b[1];
return a[2] < b[2];
}
void solve(){
int n, t, p;cin >> n >> t >> p;
vt<vt<int>> res(n);
vt<int> score(t,0);
vt<vt<int>> arr(n, vt<int>(t));
FOR(i,0,n){
FOR(j,0,t){
int u ; cin >> u;
arr[i][j] = u;
if(arr[i][j] == 0)score[j]++;
}
}
FOR(i,0,n){
int sum = 0;
int cnt = 0;
FOR(j,0,t){
if(arr[i][j])sum+=score[j], cnt++;
}
res[i] = {sum, cnt, (int)i};
}
sort(all(res), cmp);
FOR(i,0,sz(res)){
if(res[i][2] + 1 == p){
cout << res[i][0] << ' ' << res[i][2]+1 << endl;
}
}
}
int main(){
fastio;
solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |