Submission #798106

# Submission time Handle Problem Language Result Execution time Memory
798106 2023-07-30T11:16:02 Z YassirSalama Poi (IOI09_poi) C++14
20 / 100
173 ms 57712 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 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
void dbg_out() { cout << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); }
#define dbg(...) cout << "[ " << #__VA_ARGS__<< "] :", dbg_out(__VA_ARGS__);


struct st{
	int id;
	int score;
	int ntasks;
	bool operator < (const st& other) const{
		if(score==other.score) {
			if(ntasks==other.ntasks) 
				return id<other.id;
			return ntasks>other.ntasks;
		}
		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;
	int nt=0;
	for(int j=0;j<t;j++){
		sc+=v[i][j]*arr[j];
		nt+=v[i][j];
	}
	vv.push_back({.id=i+1,.score=sc,.ntasks=nt});
}
sort(all(vv));
for(int i=0;i<n;i++){
	// dbg(vv[i].id,vv[i].score,vv[i].ntasks);
	if(vv[i].id==p){
		cout<<vv[i].score<<" "<<i+1<<endl;
		return 0;
	}
}
}
# Verdict Execution time Memory Grader output
1 Correct 0 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 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Runtime error 1 ms 468 KB Execution killed with signal 11
7 Incorrect 1 ms 340 KB Output isn't correct
8 Correct 1 ms 340 KB Output is correct
9 Incorrect 1 ms 340 KB Output isn't correct
10 Runtime error 1 ms 852 KB Execution killed with signal 11
11 Incorrect 6 ms 1272 KB Output isn't correct
12 Runtime error 2 ms 3668 KB Execution killed with signal 11
13 Incorrect 28 ms 5004 KB Output isn't correct
14 Runtime error 9 ms 14036 KB Execution killed with signal 11
15 Incorrect 65 ms 12116 KB Output isn't correct
16 Runtime error 17 ms 26328 KB Execution killed with signal 11
17 Incorrect 103 ms 19164 KB Output isn't correct
18 Runtime error 27 ms 43724 KB Execution killed with signal 11
19 Runtime error 36 ms 57712 KB Execution killed with signal 11
20 Correct 173 ms 31732 KB Output is correct