Submission #922656

#TimeUsernameProblemLanguageResultExecution timeMemory
922656tvladm2009Poi (IOI09_poi)C++17
0 / 100
197 ms19048 KiB
#include <iostream> #include <complex> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <numeric> #include <cstring> #include <ctime> #include <cstdlib> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <list> #include <cmath> #include <bitset> #include <cassert> #include <queue> #include <stack> #include <deque> #include <random> using namespace std; template<typename T1, typename T2> inline void chkmin(T1 &a, T2 b) {if (a > b) a = b;} template<typename T1, typename T2> inline void chkmax(T1 &a, T2 b) {if (a < b) a = b;} #define files(FILENAME) read(FILENAME); write(FILENAME) #define read(FILENAME) freopen((FILENAME + ".in").c_str(), "r", stdin) #define write(FILENAME) freopen((FILENAME + ".out").c_str(), "w", stdout) #define all(c) (c).begin(), (c).end() #define sz(c) (int)(c).size() #define left left228 #define right right228 #define y1 y1228 #define mp make_pair #define pb push_back #define y2 y2228 #define rank rank228 using ll = long long; using ld = long double; const string FILENAME = "input"; const int MAXN = 2228; int n, t, k; int a[MAXN][MAXN]; int score[MAXN], b[MAXN], cnt[MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); //read(FILENAME); cin >> n >> t >> k; for (int i = 1; i <= n; i++) { for (int j = 1; j <= t; j++) { cin >> a[i][j]; score[j] += (a[i][j] == 0); } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= t; j++) { if (a[i][j] == 1) { b[i] += score[j]; cnt[i]++; } } } cout << b[k] << ' '; int place = 0; for (int i = 1; i <= n; i++) { if (i == k) { continue; } if (score[i] > score[k]) { place++; continue; } if (score[i] == score[k] && cnt[i] > cnt[k]) { place++; continue; } if (score[i] == score[k] && cnt[i] == cnt[k] && i < k) { place++; } } cout << place + 1 << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...