답안 #558760

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
558760 2022-05-08T09:29:06 Z karon Poi (IOI09_poi) C++14
0 / 100
250 ms 23900 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 << endl;
		}
	}
}

int main(){
	fastio;


	solve();
		
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 324 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 0 ms 212 KB Output isn't correct
5 Incorrect 1 ms 324 KB Output isn't correct
6 Incorrect 1 ms 340 KB Output isn't correct
7 Incorrect 1 ms 340 KB Output isn't correct
8 Incorrect 1 ms 340 KB Output isn't correct
9 Incorrect 2 ms 340 KB Output isn't correct
10 Incorrect 2 ms 516 KB Output isn't correct
11 Incorrect 7 ms 1056 KB Output isn't correct
12 Incorrect 15 ms 1492 KB Output isn't correct
13 Incorrect 39 ms 3788 KB Output isn't correct
14 Incorrect 55 ms 5348 KB Output isn't correct
15 Incorrect 96 ms 9180 KB Output isn't correct
16 Incorrect 101 ms 9928 KB Output isn't correct
17 Incorrect 155 ms 14536 KB Output isn't correct
18 Incorrect 179 ms 16436 KB Output isn't correct
19 Incorrect 211 ms 21572 KB Output isn't correct
20 Incorrect 250 ms 23900 KB Output isn't correct