| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 228666 | osaaateiasavtnl | Poi (IOI09_poi) | C++14 | 334 ms | 4344 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
const int N = 2007;
int n, t, p;
int cost[N];
bool a[N][N];
int sum[N], cnt[N];
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    cin >> n >> t >> p;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < t; ++j) {
            cin >> a[i][j];
            cnt[i] += a[i][j];
            if (!a[i][j])
                ++cost[j];
        }
    }   
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < t; ++j)
            if (a[i][j])
                sum[i] += cost[j];    
    }   
    --p;
    cout << sum[p] << ' ';
    int place = 0;
    for (int i = 0; i < n; ++i) {
        place += (mp(sum[i], cnt[i]) > mp(sum[p], cnt[p])) || (mp(sum[i], cnt[i]) == mp(sum[p], cnt[p]) && i < p);        
    }   
    cout << place + 1 << endl;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
