답안 #558761

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
558761 2022-05-08T09:31:01 Z karon Poi (IOI09_poi) C++14
0 / 100
568 ms 16084 KB
#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;
          	return;
		}
	}
}

int main(){

	solve();
		
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Incorrect 1 ms 212 KB Output isn't correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Incorrect 2 ms 212 KB Output isn't correct
9 Incorrect 3 ms 340 KB Output isn't correct
10 Incorrect 5 ms 340 KB Output isn't correct
11 Incorrect 19 ms 788 KB Output isn't correct
12 Incorrect 30 ms 1104 KB Output isn't correct
13 Incorrect 85 ms 2648 KB Output isn't correct
14 Incorrect 121 ms 3668 KB Output isn't correct
15 Incorrect 210 ms 6228 KB Output isn't correct
16 Incorrect 239 ms 6720 KB Output isn't correct
17 Incorrect 356 ms 9772 KB Output isn't correct
18 Incorrect 387 ms 11084 KB Output isn't correct
19 Incorrect 530 ms 14504 KB Output isn't correct
20 Incorrect 568 ms 16084 KB Output isn't correct