제출 #972650

#제출 시각아이디문제언어결과실행 시간메모리
972650marinalucaPoi (IOI09_poi)C++17
100 / 100
196 ms39768 KiB
#include <bits/stdc++.h> #pragma GCC opitmize ("O4") #pragma GCC optimize ("fast-math") #pragma GCC optimize ("unroll-loops") using namespace std; #define int long long #define ll long long #define xx first #define yy second #define all (x) begin (x), end(x) int n, t, p; const int NMAX = 2e3 + 10; int solve[NMAX][NMAX]; int puncte[NMAX]; struct elem { int idx = 0; int sc = 0; int ca = 0; friend bool operator<(elem a, elem b){ if (a.sc == b.sc){ if (a.ca == b.ca){ return a.idx > b.idx; } return a.ca < b.ca; } return a.sc < b.sc; } }v[NMAX]; signed main (void){ ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> t >> p; for (int i = 1; i <= n; ++ i){ v[i].idx = i; for (int j = 1; j <= t; ++ j){ cin >> solve[i][j]; if (solve[i][j]){ v[i].ca ++, puncte[j] ++; } } } for (int j = 1; j <= t; ++ j){ puncte[j] = n - puncte[j]; } for (int i = 1; i <= n; ++ i){ for (int j = 1; j <= t; ++ j){ if (solve[i][j]){ v[i].sc += puncte[j]; } } } sort (v + 1, v + n +1); reverse (v + 1, v + n +1); for (int i = 1; i <= n; ++ i){ if (v[i].idx == p){ cout << v[i].sc << " " << i << '\n'; break; } } return 0 ^ 0; }

컴파일 시 표준 에러 (stderr) 메시지

poi.cpp:2: warning: ignoring '#pragma GCC opitmize' [-Wunknown-pragmas]
    2 | #pragma GCC opitmize ("O4")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...