Submission #962578

#TimeUsernameProblemLanguageResultExecution timeMemory
962578starchanPoi (IOI09_poi)C++17
100 / 100
211 ms31804 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define in array<int, 2> #define f first #define s second #define pb push_back #define pob pop_back #define INF (int)1e17 #define MX (int)3e5+5 #define fast() ios_base::sync_with_stdio(false); cin.tie(NULL) signed main() { fast(); int n, t, p; cin >> n >> t >> p; p--; int a[n][t]; int b[n][t]; int d[t]; for(int i = 0; i < t; i++) d[i] = 0; array<int, 3> sc[n]; for(int i = 0; i < n; i++) { sc[i][0] = sc[i][1] = 0; for(int j = 0; j < t; j++) { cin >> a[i][j]; if(!a[i][j]) d[j]++; sc[i][1]-=a[i][j]; } sc[i][2] = i; } for(int i = 0; i < n; i++) { for(int j = 0; j < t; j++) { cin >> a[i][j]; if(a[i][j]) sc[i][0]-=d[j]; } } sort(sc, sc+n); for(int i = 0; i < n; i++) { if(sc[i][2] == p) cout << (-sc[i][0]) << " " << (i+1) << "\n"; } return 0; }

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:20:6: warning: unused variable 'b' [-Wunused-variable]
   20 |  int b[n][t];
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...