제출 #232932

#제출 시각아이디문제언어결과실행 시간메모리
232932ZexPoi (IOI09_poi)C++11
100 / 100
311 ms12152 KiB
#include<bits/stdc++.h> using namespace std; #define LL long long #define INF INT_MAX #define LD long double #define endl '\n' #define output for(LL i=0;i<sizex;i++) { for(LL j=0;j<sizey;j++) { cout << A[i][j] << " "; }cout<<endl; }cout<<endl; struct con{ int ID, tasks, points; con(){ ID = tasks = points = 0; } bool operator < ( const con &o ) const{ if( points != o.points ) return points > o.points; if( tasks != o.tasks ) return tasks > o.tasks; return ID < o.ID; } }; const int maxN = 2001; int N, T, ID; int points[maxN]; vector <con> A(maxN); bool M[maxN][maxN]; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N >> T >> ID; A.resize(N+1); for(int i=1;i<=N;i++) { A[i].ID = i; A[i].tasks = A[i].points = 0; } for(int i=1;i<=T;i++) points[i] = N; for(int i=1;i<=N;i++) for(int j=1;j<=T;j++){ cin >> M[i][j]; if( M[i][j] ) { points[j]--; A[i].tasks++; } } // for(int i=1;i<=T;i++) cout << i << ": " << points[i] << endl; // cout << endl; for(int i=1;i<=N;i++) for(int j=1;j<=T;j++){ if( M[i][j] ) A[i].points += points[j]; } sort( A.begin(), A.end() ); // for(int i=0;i<A.size();i++){ // cout << A[i].ID << ": " << A[i].tasks << ' ' << A[i].points << endl; // } for(int i=0;i<A.size();i++){ if( A[i].ID == ID ){ cout << A[i].points << ' ' << i+1 << endl; return 0; } } }

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

poi.cpp: In function 'int main()':
poi.cpp:55:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<A.size();i++){
                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...