제출 #782134

#제출 시각아이디문제언어결과실행 시간메모리
782134MatblubePoi (IOI09_poi)C++14
100 / 100
193 ms39464 KiB
#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 && a.y==b.y) return a.z<b.z; 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 timeMemoryGrader output
Fetching results...