Submission #397592

#TimeUsernameProblemLanguageResultExecution timeMemory
397592ak2006Poi (IOI09_poi)C++14
100 / 100
751 ms23948 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vb = vector<bool>; using vvb = vector<vb>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using vc = vector<char>; using vvc = vector<vc>; const ll mod = 1e9 + 7,inf = 1e18; #define pb push_back #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); bool cmp(vi&a,vi&b) { return (a[0] > b[0]) || (a[0] == b[0] && a[1] > b[1]) || (a[0] == b[0] && a[1] == b[1] && a[2] < b[2]); } int main() { int n,t,p; cin>>n>>t>>p; vvi a(n,vi(t)); vi score(t); for (int i = 0;i<n;i++) for (int j = 0;j<t;j++)cin>>a[i][j],score[j] += 1 - a[i][j]; vvi consider(n,vi(3)); for (int i = 0;i<n;i++){ for (int j = 0;j<t;j++)if (a[i][j])consider[i][1]++,consider[i][0] += score[j]; consider[i][2] = i; } cout<<consider[p - 1][0]<<" "; sort(consider.begin(),consider.end(),cmp); for (int i = 0;i<n;i++){ if (consider[i][2] == p - 1){cout<<i + 1;return 0;} } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...