# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
921523 |
2024-02-04T05:34:59 Z |
josanneo22 |
Poi (IOI09_poi) |
C++17 |
|
182 ms |
23868 KB |
#pragma warning(suppress : 4996)
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize(3)
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
// char buf[1 << 23], * p1 = buf, * p2 = buf;
// #define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template<typename T> inline void read(T& x) { x = 0; T f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) { x = x * (1 << 1) + x * (1 << 3) + (ch - 48); ch = getchar(); } x *= f; }
template<typename x, typename... y>void read(x& a, y&... b) { read(a); read(b...); }
template<typename T> inline void print(T x) { if (x < 0) { putchar('-'); x = -x; } if (x > 9) print(x / 10); putchar(x % 10 + '0'); }
template<typename x, typename... y>void print(x& a, y&... b) { print(a); putchar(' '); print(b...); }
#define sp putchar(' ')
#define nl putchar('\n')
#define printv(a) for(int p = 0; p < a.size(); p++) print(a[p]), (p == a.size() - 1? nl : sp);
#define L(i,j,k) for(int i=(j);i<=(k);++i)
#define R(i,j,k) for(int i=(j);i>=(k);--i)
#define all(x) x.begin(),x.end()
#define me(x,a) memset(x,a,sizeof(x))
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int N, M; int id;
read(N, M, id);
vector<int> people_not_scoring(M + 1, N);
vector<vector<int>> a(N + 1, vector<int>(M + 1));
L(i, 1, N) {
L(j, 1, M) {
cin >> a[i][j];
people_not_scoring[j] -= (a[i][j]);
}
}
vector<int> score(N + 1);
L(i, 1, N) {
L(j, 1, M) {
score[i] += a[i][j] * people_not_scoring[j];
}
}
vector<int> ord(N);
iota(all(ord), 1);
sort(all(ord), [&](int i, int j) {
if (score[i] == score[j]) return i < j;
return score[i] > score[j];
});
L(i, 0, N - 1) {
if (ord[i] == id) {
cout << score[id] << ' ' << i + 1 << '\n';
}
}
}
Compilation message
poi.cpp:1: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
1 | #pragma warning(suppress : 4996)
|
poi.cpp:7: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
7 | #pragma GCC optimization ("unroll-loops")
|
poi.cpp:29:39: warning: bad option '-fwhole-program' to pragma 'optimize' [-Wpragmas]
29 | #pragma GCC optimize("-fwhole-program")
| ^
poi.cpp:36:41: warning: bad option '-fstrict-overflow' to pragma 'optimize' [-Wpragmas]
36 | #pragma GCC optimize("-fstrict-overflow")
| ^
poi.cpp:38:41: warning: bad option '-fcse-skip-blocks' to pragma 'optimize' [-Wpragmas]
38 | #pragma GCC optimize("-fcse-skip-blocks")
| ^
poi.cpp:52:51: warning: bad option '-funsafe-loop-optimizations' to pragma 'optimize' [-Wpragmas]
52 | #pragma GCC optimize("-funsafe-loop-optimizations")
| ^
poi.cpp:57:43: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
57 | template<typename T> inline void read(T& x) { x = 0; T f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) { x = x * (1 << 1) + x * (1 << 3) + (ch - 48); ch = getchar(); } x *= f; }
| ^
poi.cpp:57:43: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
poi.cpp:57:43: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
poi.cpp:57:43: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
poi.cpp:58:59: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
58 | template<typename x, typename... y>void read(x& a, y&... b) { read(a); read(b...); }
| ^
poi.cpp:58:59: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
poi.cpp:58:59: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
poi.cpp:58:59: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
poi.cpp:59:43: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
59 | template<typename T> inline void print(T x) { if (x < 0) { putchar('-'); x = -x; } if (x > 9) print(x / 10); putchar(x % 10 + '0'); }
| ^
poi.cpp:59:43: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
poi.cpp:59:43: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
poi.cpp:59:43: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
poi.cpp:60:60: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
60 | template<typename x, typename... y>void print(x& a, y&... b) { print(a); putchar(' '); print(b...); }
| ^
poi.cpp:60:60: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
poi.cpp:60:60: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
poi.cpp:60:60: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
poi.cpp:70:10: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
70 | int main() {
| ^
poi.cpp:70:10: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
poi.cpp:70:10: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
poi.cpp:70:10: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
poi.cpp: In function 'int main()':
poi.cpp:92:36: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
92 | sort(all(ord), [&](int i, int j) {
| ^
poi.cpp:92:36: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
poi.cpp:92:36: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
poi.cpp:92:36: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
11 |
Incorrect |
6 ms |
1116 KB |
Output isn't correct |
12 |
Incorrect |
9 ms |
1628 KB |
Output isn't correct |
13 |
Incorrect |
27 ms |
3932 KB |
Output isn't correct |
14 |
Incorrect |
38 ms |
5460 KB |
Output isn't correct |
15 |
Incorrect |
65 ms |
9300 KB |
Output isn't correct |
16 |
Incorrect |
77 ms |
10336 KB |
Output isn't correct |
17 |
Incorrect |
107 ms |
14376 KB |
Output isn't correct |
18 |
Incorrect |
121 ms |
16276 KB |
Output isn't correct |
19 |
Incorrect |
160 ms |
21584 KB |
Output isn't correct |
20 |
Incorrect |
182 ms |
23868 KB |
Output isn't correct |