# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
879462 |
2023-11-27T13:36:05 Z |
amin_2008 |
Poi (IOI09_poi) |
C++17 |
|
209 ms |
36376 KB |
#pragma GCC optimize ("O3")
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
// author: amin_2008
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long
#define vi vector<int>
#define vs vector<string>
#define vc vector<char>
#define vl vector<ll>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb push_back
#define bpc __builtin_popcount
#define pii pair<int, int>
#define pll pair<ll, ll>
#define piii pair<pii, int>
#define vpii vector<pii>
#define vpll vector<pll>
#define vvpii vector<vpii>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define ins insert
#define ts to_string
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define ld long double
#define ull unsigned long long
#define endl '\n'
//#define int ll
using namespace std;
using namespace __gnu_pbds;
using namespace __cxx11;
template<class T> using ordered_set = tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int inf = 1e9;
const int mod = 1e9+7;
const int sz = 2005;
const int N = 100005;
const int logg = 18;
const int P = 40000005;
const int M = 5e5+5;
int a[sz];
struct var
{
int point = 0;
int solved = 0;
int in = 0;
};
bool cmp(var a, var b)
{
if ( a.point == b.point and a.solved == b.solved ) return a.in < b.in;
else if ( a.point == b.point ) return a.solved > b.solved;
return a.point > b.point;
}
void solve()
{
int n, t, p;
cin >> n >> t >> p;
vvi mat(n + 1, vi (t + 1));
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
cin >> mat[i][j];
vi points(t + 1);
for(int i = 1; i <= t; i++)
for(int j = 1; j <= n; j++)
points[i] += ( !mat[j][i] );
vector<var> v(n);
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= t; j++)
{
if ( mat[i][j] )
v[i-1].point += points[j],
v[i-1].solved += ( mat[i][j] );
}
v[i-1].in = i;
}
sort(all(v), cmp);
for(int i = 0; i < n; i++)
{
if ( v[i].in == p )
{
cout << v[i].point << ' ' << i + 1 << endl;
return;
}
}
}
signed main()
{
ios;
//precompute();
int t = 1;
//cin >> t;
while(t--){
solve();
}
}
Compilation message
poi.cpp: In function 'bool cmp(var, var)':
poi.cpp:66:10: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
66 | else if ( a.point == b.point ) return a.solved > b.solved;
| ^~
poi.cpp:67:59: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
67 | return a.point > b.point;
| ^~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
504 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
5 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
6 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
9 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
10 |
Runtime error |
3 ms |
860 KB |
Execution killed with signal 6 |
11 |
Incorrect |
5 ms |
1116 KB |
Output isn't correct |
12 |
Runtime error |
11 ms |
2648 KB |
Execution killed with signal 6 |
13 |
Incorrect |
25 ms |
3932 KB |
Output isn't correct |
14 |
Runtime error |
44 ms |
9052 KB |
Execution killed with signal 6 |
15 |
Incorrect |
70 ms |
9320 KB |
Output isn't correct |
16 |
Runtime error |
83 ms |
16720 KB |
Execution killed with signal 6 |
17 |
Incorrect |
109 ms |
14508 KB |
Output isn't correct |
18 |
Runtime error |
141 ms |
27680 KB |
Execution killed with signal 6 |
19 |
Runtime error |
192 ms |
36376 KB |
Execution killed with signal 6 |
20 |
Correct |
209 ms |
24008 KB |
Output is correct |