Submission #798104

# Submission time Handle Problem Language Result Execution time Memory
798104 2023-07-30T11:15:39 Z YassirSalama Poi (IOI09_poi) C++14
0 / 100
176 ms 57740 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 Incorrect 0 ms 212 KB Output isn't correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Runtime error 2 ms 596 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 340 KB Output isn't correct
10 Runtime error 1 ms 852 KB Execution killed with signal 11
11 Incorrect 5 ms 1236 KB Output isn't correct
12 Runtime error 2 ms 3668 KB Execution killed with signal 11
13 Incorrect 26 ms 5008 KB Output isn't correct
14 Runtime error 12 ms 14036 KB Execution killed with signal 11
15 Incorrect 72 ms 12116 KB Output isn't correct
16 Runtime error 16 ms 26392 KB Execution killed with signal 11
17 Incorrect 103 ms 19304 KB Output isn't correct
18 Runtime error 27 ms 43724 KB Execution killed with signal 11
19 Runtime error 36 ms 57740 KB Execution killed with signal 11
20 Incorrect 176 ms 31716 KB Output isn't correct