# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
233462 |
2020-05-20T14:59:19 Z |
AmineWeslati |
ACM (COCI19_acm) |
C++14 |
|
7 ms |
512 KB |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef string str;
typedef long long ll;
#define int ll
typedef double db;
typedef long double ld;
typedef pair<int,int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
#define pb push_back
#define eb emplace_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
const int MOD = 1e9+7; //998244353
const ll INF = 1e18;
const int nx[4]={0,0,1,-1}, ny[4]={1,-1,0,0};
const str hero="NijeZivotJedanACM";
int32_t main(){
boost;
int N,M;cin>>N>>M;
vector<pair<pi,str>> vec;
for(int i=0; i<N; i++){
str n; cin>>n;
int x=0,y=0;
for(int j=0; j<M; j++){
str m; cin>>m;
if(n==hero) continue;
if(m[0]=='?'||m[0]=='+'){
x++;
y+=(m[1]-'0')*20;
y+=(m[4]-'0')*60; y+=((m[6]-'0')*10+m[7]-'0'); y+=((m[9]-'0')*10+m[10]-'0');
}
}
vec.pb({{x,y},n});
}
sort(all(vec));
int x=0,y=0;
for(int j=0; j<M; j++){
str m; cin>>m;
if(m[0]=='+'){
x++;
y+=(m[1]-'0')*20;
y+=(m[4]-'0')*60; y+=((m[6]-'0')*10+m[7]-'0'); y+=((m[9]-'0')*10+m[10]-'0');
}
}
pair<pi,str> p={{x,y},hero};
auto it=lower_bound(all(vec),p)-vec.begin();
cout << it+1 << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
7 ms |
512 KB |
Output isn't correct |
3 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
4 |
Incorrect |
6 ms |
512 KB |
Output isn't correct |
5 |
Incorrect |
6 ms |
512 KB |
Output isn't correct |