# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
340262 | A_D | ACM (COCI19_acm) | C++14 | 7 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
ID: antwand1
TASK: barn1
LANG: C++
*/
#include <bits/stdc++.h>
#define ll long long
#define du long double
#define F first
#define S second
using namespace std;
const int N=1e3+100;
string f="NijeZivotJedanACM";
pair<pair<ll,ll>,string> a[N];
main()
{
//freopen("barn1.in","r",stdin);freopen("barn1.out","w",stdout);
int n,m;
cin>>n>>m;
int cu=0;
for(int i=1;i<=n;i++){
string res;
cin>>res;
if(res==f){
cu=i;
}
ll ad=0,pen=0;
for(int j=1;j<=m;j++){
ll ben=0;
string t;
cin>>t;
if(t[0]=='-')continue;
ad++;
ll q=0;
reverse(t.begin(),t.end());
t.pop_back();
while(t.back()!='/'){
ben*=10;
ben+=t.back()-'0';
t.pop_back();
}
t.pop_back();
ben*=20*60;
reverse(t.begin(),t.end());
ll h=(t[0]-'0')*10+(t[1]-'0');
reverse(t.begin(),t.end());
ben+=h*3600;
t.pop_back();t.pop_back();t.pop_back();
reverse(t.begin(),t.end());
h=(t[0]-'0')*10+(t[1]-'0');
reverse(t.begin(),t.end());
ben+=h*60;
t.pop_back();t.pop_back();t.pop_back();
reverse(t.begin(),t.end());
h=(t[0]-'0')*10+(t[1]-'0');
ben+=h;
pen+=ben;
}
//break;
a[i]={{-ad,pen},res};
}
string res;
cin>>res;
int i=cu;
ll ad=0,pen=0;
for(int j=1;j<=m;j++){
ll ben=0;
string t;
cin>>t;
if(t[0]=='-')continue;
ad++;
ll q=0;
reverse(t.begin(),t.end());
t.pop_back();
while(t.back()!='/'){
ben*=10;
ben+=t.back()-'0';
t.pop_back();
}
t.pop_back();
ben*=20*60;
reverse(t.begin(),t.end());
ll h=(t[0]-'0')*10+(t[1]-'0');
reverse(t.begin(),t.end());
ben+=h*3600;
t.pop_back();t.pop_back();t.pop_back();
reverse(t.begin(),t.end());
h=(t[0]-'0')*10+(t[1]-'0');
reverse(t.begin(),t.end());
ben+=h*60;
t.pop_back();t.pop_back();t.pop_back();
reverse(t.begin(),t.end());
h=(t[0]-'0')*10+(t[1]-'0');
ben+=h;
pen+=ben;
}
a[i]={{-ad,+pen},res};
sort(a+1,a+n+1);
for(int i=1;i<=n;i++){
// cout<<a[i].F.F<<" "<<a[i].F.S<<" "<<a[i].S<<endl;
if(a[i].S==f){
cout<<i<<endl;
//break;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |