Submission #632239

# Submission time Handle Problem Language Result Execution time Memory
632239 2022-08-19T18:19:31 Z device Poi (IOI09_poi) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
bool cmp(pair<int,pair<int,int>> a, pair<int,pair<int,int>> b){
	if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
	else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
	else return a.ff < b.ff;
}
void solve(int testcase){
	int n,t,p; cin >> n >> t >> p;
	pair<int,int> par[n+1];
	vector<int> psolved[t+1];
	int tsolved[t+1] = {};
	for(int i = 1; i <= n; i++) par[i] = {0,0};
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= t; j++){
			int cmd; cin >> cmd;
			if(cmd){
				psolved[j].pb(i);
				tsolved[j]++;
				par[i].ss++;
			}
		}
	}
	for(int i = 1; i <= t; i++){
		for(int nxt:psolved[i]){
			par[nxt].ff += n-tsolved[i];
		}
	}
	vector<pair<int,pair<int,int>>> v;
	for(int i = 1; i <= n; i++){
		v.pb({i,par[i]});
	}
	sort(v.begin(),v.end(),cmp);
	for(int i = 0; i < n; i++){
		if(v[i].ff == p) cout << v[i].ss.ff << " " << i+1 << "\n";
	}
}

Compilation message

poi.cpp: In function 'bool cmp(std::pair<int, std::pair<int, int> >, std::pair<int, std::pair<int, int> >)':
poi.cpp:5:7: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    5 |  if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
      |       ^~
poi.cpp:5:18: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    5 |  if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
      |                  ^~
poi.cpp:5:34: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    5 |  if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
      |                                  ^~
poi.cpp:5:44: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    5 |  if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
      |                                            ^~
poi.cpp:6:12: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    6 |  else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
      |            ^~
poi.cpp:6:23: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    6 |  else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
      |                       ^~
poi.cpp:6:39: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    6 |  else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
      |                                       ^~
poi.cpp:6:49: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ss'
    6 |  else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
      |                                                 ^~
poi.cpp:7:16: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ff'
    7 |  else return a.ff < b.ff;
      |                ^~
poi.cpp:7:23: error: 'struct std::pair<int, std::pair<int, int> >' has no member named 'ff'
    7 |  else return a.ff < b.ff;
      |                       ^~
poi.cpp: In function 'void solve(int)':
poi.cpp:21:12: error: 'struct std::pair<int, int>' has no member named 'ss'
   21 |     par[i].ss++;
      |            ^~
poi.cpp:27:13: error: 'struct std::pair<int, int>' has no member named 'ff'
   27 |    par[nxt].ff += n-tsolved[i];
      |             ^~
poi.cpp:36:11: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::pair<int, int> > >, std::pair<int, std::pair<int, int> > >::value_type' {aka 'struct std::pair<int, std::pair<int, int> >'} has no member named 'ff'
   36 |   if(v[i].ff == p) cout << v[i].ss.ff << " " << i+1 << "\n";
      |           ^~
poi.cpp:36:33: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::pair<int, int> > >, std::pair<int, std::pair<int, int> > >::value_type' {aka 'struct std::pair<int, std::pair<int, int> >'} has no member named 'ss'
   36 |   if(v[i].ff == p) cout << v[i].ss.ff << " " << i+1 << "\n";
      |                                 ^~