제출 #739261

#제출 시각아이디문제언어결과실행 시간메모리
739261UnforgettableplPoi (IOI09_poi)C++17
100 / 100
268 ms25508 KiB
/* ID: samikgo1 TASK: LANG: C++ */ #include <bits/stdc++.h> using namespace std; typedef unsigned long long ll; typedef pair<ll,ll> pll; #define all(x) x.begin(),x.end() #define allr(x) x.rbegin(),x.rend() //#define f first //#define s second //#define x first //#define y second const int INF = INT32_MAX; bool compa(vector<ll> &a, vector<ll> &b){ if(a[0]==b[0]){ if(a[1]==b[1]){ return a[2]<b[2]; } else { return a[1]>b[1]; } } else { return a[0]>b[0]; } } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); // freopen("measurement.in","r",stdin); // freopen("measurement.out","w",stdout); ll n,t,p; cin >> n >> t >> p; p--; vector<ll> marks(t,0); vector<vector<ll>> scores(n,vector<ll>(3)); vector<vector<ll>> solved(n); for (int i = 0; i < n; i++) { for (int j = 0; j < t; j++) { int a; cin >> a; if(a){ solved[i].emplace_back(j); } else { marks[j]++; } } } for (int i = 0; i < n; i++) { scores[i][2] = i; scores[i][1] = solved[i].size(); scores[i][0] = 0; for (auto &j: solved[i]) { scores[i][0]+=marks[j]; } } sort(all(scores),compa); for (int i = 0; i < n; i++) { if(scores[i][2]==p){ cout << scores[i][0] << ' ' << i+1; return 0; } } }

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

poi.cpp: In function 'int main()':
poi.cpp:41:23: warning: comparison of integer expressions of different signedness: 'int' and 'll' {aka 'long long unsigned int'} [-Wsign-compare]
   41 |     for (int i = 0; i < n; i++) {
      |                     ~~^~~
poi.cpp:42:27: warning: comparison of integer expressions of different signedness: 'int' and 'll' {aka 'long long unsigned int'} [-Wsign-compare]
   42 |         for (int j = 0; j < t; j++) {
      |                         ~~^~~
poi.cpp:52:23: warning: comparison of integer expressions of different signedness: 'int' and 'll' {aka 'long long unsigned int'} [-Wsign-compare]
   52 |     for (int i = 0; i < n; i++) {
      |                     ~~^~~
poi.cpp:61:23: warning: comparison of integer expressions of different signedness: 'int' and 'll' {aka 'long long unsigned int'} [-Wsign-compare]
   61 |     for (int i = 0; i < n; i++) {
      |                     ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...