제출 #629903

#제출 시각아이디문제언어결과실행 시간메모리
629903chinmoy_101Poi (IOI09_poi)C++14
5 / 100
519 ms680 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long bool cmp(pair<int, pair<int, int>>a, pair<int, pair<int, int>>b) { if(a.second.second!=b.second.second) { return a.second.second>b.second.second; } else { if(a.second.first!=b.second.first) { return a.second.first>b.second.first; } else { return a.first<b.first; } } } int main() { int n, t, p; cin>>n >>t >>p; vector<int> points_for_each_task_array(t, 0); vector<vector<int> > arr(n, {0, 0}); vector<pair<int, pair<int, int>> > final_standing(n, {0, {0, 0}}); for(int i=0; i<n; i++) { for(int j=0; j<t; j++) { cin>>arr[i][j]; if(arr[i][j]==0) { points_for_each_task_array[j]++; } } } for(int i=0; i<n; i++) { int ans=0, no_of_problems_solved=0; for(int j=0; j<t; j++) { if(arr[i][j]==1) { ans+=points_for_each_task_array[j]; no_of_problems_solved++; } } //id no.ofproblems solved, ans final_standing[i]={i+1, {no_of_problems_solved, ans} }; } sort(final_standing.begin(), final_standing.end(), cmp); for(int i=0; i<final_standing.size(); i++) { if(final_standing[i].first==p) { cout<<final_standing[i].second.second <<" " <<i+1; } } return 0; }

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

poi.cpp: In function 'int main()':
poi.cpp:55:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |     for(int i=0; i<final_standing.size(); i++)
      |                  ~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...