| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 366747 | kostia244 | Poi (IOI09_poi) | C++17 | 279 ms | 24044 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(x) begin(x), end(x)
const int maxn = 2020;
int n, m, p, score[maxn], val[maxn], cnt[maxn], a[maxn][maxn];
int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> n >> m >> p;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++) {
			cin >> a[i][j], 
			val[j] += !a[i][j], 
			cnt[i] += a[i][j];
		}
	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++)
			score[i] += val[j]*a[i][j];
	vector<array<int, 3>> f(n);
	for(int i = 0; i < n; i++) f[i] = {-score[i], -cnt[i], i};
	sort(all(f));
	int ans = 0;--p;
	while(f[ans][2] != p) ans++;
	cout << -f[ans][0] << " " << ans+1 << '\n';
} 
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
