제출 #933634

#제출 시각아이디문제언어결과실행 시간메모리
933634NeytrinoPoi (IOI09_poi)C++14
5 / 100
193 ms23860 KiB
	/**
	*    author:    inastranets
	*    created:   26.02.2024 05:31:30		
	**/
	#include <bits/stdc++.h>

	using namespace std;

	int main() {
		ios_base::sync_with_stdio(false);
		cin.tie(0);

		int n, t, p;

		cin >> n >> t >> p;

		vector<vector<int>> solved(n, vector<int>(t, 0));
		vector<int> points(t, 0);

		for (int i = 0; i < n; ++ i) {
			for (int j = 0; j < t; ++ j) {
				cin >> solved[i][j];
				points[j] += (solved[i][j] == 0);
			}
		}
                                                         
    vector<pair<int,int> > score;

    for (int i = 0; i < n; ++ i) {
    	int result = 0;
    	for (int j = 0; j < t; ++ j) {  		
    		if (solved[i][j]) {
    			result += points[j];
    		}
    	}
    	score.push_back({result, i + 1});
    }

    sort(score.begin(), score.end(), [](const pair<int,int>& a, const pair<int,int>& b) {
    	if (a.first == b.first) {
    		return a.second < b.second;
    	}
    	return a.first < b.first;
    });

    for (int i = 0; i < n; ++ i) {
    	auto [rank, id] = score[i];
    	if (id == p) {
    		cout << rank << ' ' << i + 1;
    		break;
    	}
    }
 		return 0;
	}	

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

poi.cpp: In function 'int main()':
poi.cpp:47:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   47 |      auto [rank, id] = score[i];
      |           ^
#Verdict Execution timeMemoryGrader output
Fetching results...