| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360891 | ddl | Poi (IOI09_poi) | C++20 | 122 ms | 31856 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
#define PI 3.14159265358979323846264
template<typename T>
using vec = vector<T>;
mt19937_64 rng(chrono::high_resolution_clock().now().time_since_epoch().count());
const int maxN = 2000;
int n, t, p;
int point[maxN + 5];
array<int, maxN + 5> solved[maxN + 5];
vec<int> rank_points;
int fpt;
void solve() {
cin >> n >> t >> p;
fill(point, point + t + 1, n);
for (int i=1; i<=n; ++i) {
for (int j=1; j<=t; ++j) {
int sol;
cin >> sol;
solved[i][j] += sol;
if (sol)
point[j]--;
}
}
for (int i=1; i<=n; ++i) {
int total = 0;
for (int j=1; j<=t; ++j) {
if (solved[i][j]) total += point[j];
}
rank_points.push_back(total);
if (i==p) fpt = total;
}
sort(all(rank_points));
rank_points.erase(unique(all(rank_points)), rank_points.end());
cout << fpt << " ";
int pos = lower_bound(all(rank_points), fpt) - rank_points.begin() + 1;
cout << pos;
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
if(fopen("TASK.in", "r")){
freopen("TASK.in", "r", stdin);
freopen("TASK.out", "w", stdout);
}
int tc = 1;
while (tc--) {
solve();
}
cerr << "\nTime elapsed: " << (1.0 * clock() / CLOCKS_PER_SEC) << ".s\n";
}
Compilation message (stderr)
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
