# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1087285 |
2024-09-12T12:28:06 Z |
vjudge1 |
Izbori (COCI17_izbori) |
C++17 |
|
1 ms |
460 KB |
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
#define int long long
#define endl '\n'
const int mxn = 501;
const int mod = 1e8;
// int dx[] = {0 , 0 , 1 , -1};
// int dy[] = {1 , -1 , 0 , 0};
//DFS
//----------------------------------
// vector<int> adj[mxn];
// int n , m;
// bool vis[mxn];
// int P[mxn];
// int rem[mxn];
// void dfs(int i){
// vis[i] = 1;
// for(auto j : adj[i]){
// if(!vis[j]){
// P[j] = i;
// dfs(j);
// }
// }
// return;
// }
//----------------------------------
//Seg-Tree
//----------------------------------
// int Tree[1 << (int)(ceil(log2(mxn))) + 1];
// int N = 1 << (int)(ceil(log2(mxn)));
// int l ,r;
// int Search(int i , int lr , int rr){
// if(lr >= l and rr <= r){
// return Tree[i];
// }
// if(lr > r or rr < l) return -1;
// return max(Search(i * 2 , lr , (lr + rr) / 2) , Search(i * 2 + 1 , (lr + rr) / 2 + 1 , rr));
// }
// void update(int i){
// while(i /= 2){
// Tree[i] = max(Tree[i * 2] , Tree[i * 2 + 1]);
// }
// return;
// }
//----------------------------------
//comp
//----------------------------------
// map<int , int>mp;
// map<int , int>pm;
// void comp(set<int>s)
// {
// int idx = 0;
// for(auto i : s){
// mp[i] = idx;
// pm[idx] = i;
// idx ++;
// }
// }
//----------------------------------
signed main() {
cin.tie(0) -> sync_with_stdio(0);
int n , m , k;
cin >> n >> m >> k;
int x;
int cnt[m + 1] = {};
int mx = 1;
for(int i = 1 ; i <= n; i++){
for(int j = m ; j >= 1 ; j--){
cin >> x;
cnt[x] += j;
if(cnt[x] > cnt[mx]) mx = x;
if(cnt[x] == cnt[mx] and x < mx) mx = x;
}
}
cout << mx << endl;
int sol = 0;
for(int i = 1; i <= m ; i++){
if(i == k) continue;
if(cnt[i] > cnt[k] || (cnt[i] == cnt[k] and i < k)) sol++;
}
cout << sol;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Partially correct |
0 ms |
348 KB |
Partially correct |
3 |
Incorrect |
0 ms |
456 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
5 |
Partially correct |
0 ms |
348 KB |
Partially correct |
6 |
Partially correct |
0 ms |
348 KB |
Partially correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
9 |
Partially correct |
0 ms |
404 KB |
Partially correct |
10 |
Partially correct |
1 ms |
348 KB |
Partially correct |
11 |
Correct |
0 ms |
460 KB |
Output is correct |
12 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
13 |
Partially correct |
1 ms |
348 KB |
Partially correct |
14 |
Partially correct |
0 ms |
348 KB |
Partially correct |
15 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
16 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
17 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
18 |
Partially correct |
0 ms |
348 KB |
Partially correct |
19 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
20 |
Partially correct |
1 ms |
348 KB |
Partially correct |