# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
221211 | tatyam | Poi (IOI09_poi) | C++17 | 137 ms | 1016 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using tuplis = array<int, 3>;
#define name2(a,b,c,...) c
#define rep1(b) for(int i = 0; i < b; i++)
#define rep2(i,b) for(int i = 0; i < b; i++)
#define rep(...) name2(__VA_ARGS__,rep2,rep1)(__VA_ARGS__)
#define each(i,a) for(auto&& i : a)
#define all(a) begin(a), end(a)
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n, t, p;
cin >> n >> t >> p;
p--;
vector<vector<bool>> a(t, vector<bool>(n));
rep(n) rep(j, t){
char c;
cin >> c;
a[j][i] = c & 1;
}
vector<int> point(t);
rep(t) point[i] = n - accumulate(all(a[i]), 0);
vector<tuplis> b(n);
rep(n){
b[i][2] = i;
rep(j, t) if(a[j][i]){
b[i][0] -= point[j];
b[i][1]--;
}
}
sort(all(b));
rep(n) if(b[i][2] == p) cout << -b[i][0] << ' ' << i + 1 << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |