Submission #798089

# Submission time Handle Problem Language Result Execution time Memory
798089 2023-07-30T11:04:48 Z YassirSalama Poi (IOI09_poi) C++14
10 / 100
179 ms 57796 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <iomanip>
#include <cmath>
#include <limits>
#include <map>
#include <utility>
#include <cctype>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <functional>
#include <iterator>
using namespace std;
#define OVL(x,s) for(auto y:x) cout<<y<<s; cout<<"\n";
#define dbg(x) cout << "[ " << #x << " ] : " << x<<endl;
#define endl "\n"
#define pb push_back
#define F first
#define S second
#define ll long long
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define int long long

struct st{
	int id;
	int score;
	bool operator < (const st& other) const{
		if(score==other.score) return id<other.id;
		return score>other.score;
	}
};
signed main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int n,t,p;
cin>>n>>t>>p;
int arr[t];
for(int i=0;i<n;i++) arr[i]=n;
vector<vector<int>> v(n,vector<int>(t,0));
for(int i=0;i<n;i++){
	for(int j=0;j<t;j++){
		cin>>v[i][j];
		arr[j]-=v[i][j];
	}
}
vector<st> vv;
for(int i=0;i<n;i++){
	int sc=0;
	for(int j=0;j<t;j++){
		sc+=v[i][j]*arr[j];
	}
	vv.push_back({.id=i+1,.score=sc,});
}
sort(all(vv));
for(int i=0;i<n;i++){
	if(vv[i].id==p){
		cout<<vv[i].score<<" "<<i+1<<endl;
		return 0;
	}
}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Runtime error 2 ms 572 KB Execution killed with signal 6
7 Incorrect 1 ms 340 KB Output isn't correct
8 Incorrect 1 ms 340 KB Output isn't correct
9 Incorrect 1 ms 468 KB Output isn't correct
10 Runtime error 1 ms 932 KB Execution killed with signal 11
11 Incorrect 9 ms 1492 KB Output isn't correct
12 Runtime error 3 ms 3624 KB Execution killed with signal 11
13 Incorrect 30 ms 6140 KB Output isn't correct
14 Runtime error 9 ms 14100 KB Execution killed with signal 11
15 Incorrect 67 ms 15032 KB Output isn't correct
16 Runtime error 20 ms 26372 KB Execution killed with signal 11
17 Incorrect 109 ms 23888 KB Output isn't correct
18 Runtime error 34 ms 43784 KB Execution killed with signal 11
19 Runtime error 36 ms 57796 KB Execution killed with signal 11
20 Correct 179 ms 39504 KB Output is correct