| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 362266 | AzizCherif | Poi (IOI09_poi) | C++14 | 354 ms | 23996 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//ASSLEMA :)
#include <bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
typedef long long ll;
typedef double db;
typedef long double ldb;
//#define int ll //..................................................................
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<db> vdb;
typedef vector<string> vs;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define endl '\n'
ll gcd(ll a, ll b){ return b?gcd(b, a % b):a; }
ll lcm(ll a, ll b){ return (a*b)/gcd(a, b); }
void IO() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int32_t main(){
    boost; IO();
    int n, t, p;
    cin>>n>>t>>p;
    vector<vi> input(n);
    for(int i=0; i<n; i++){
        vi temp;
        for(int j=0; j<t; j++){
            int x; cin>>x;
            temp.pb(x);
        }
        input[i]=temp;
    }
    vi scores(t); 
    scores.assign(t, n);
    for(int i=0; i<t; i++){
        for(int j=0; j<n; j++){
            if(input[j][i]==1){
                scores[i]--;
            }
        }
    }
    vector<pair<pi, int>> board;//score, nb_poblems, ' ' , ID
    for(int i=0; i<n; i++){
        int sc=0, nb=0;
        for(int j=0; j<t; j++){
            if(input[i][j]==1){
                sc+=scores[j];
                nb++;
            }
        }
        board.pb(mp(mp(sc, nb), i+1));
    }
    sort(all(board));
    for(int i=0; i<n; i++){
        if(board[i].se==p){
            cout<<board[i].fi.fi<<' '<<i+1;
            break;
        }
    }
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
