题目
好久没敲过恶心的模拟题了,莫名有点怀念是什么鬼,我还记得我的zamjena
没啥想说的,这道题就是没智商有码力的
纯粹是纪念一下今天上午直接肝了的两个半小时,真的一点思维都不需要有,直接上!!
我的手都没停下过,无非难调了一点,经常打飞而已啦~
#include <map>
#include <cstdio>
#include <vector>
using namespace std;
#define MAXN 4005
#define MAXM 150005
#define int long long
struct node {int id, s, a, b, f, c, ans;char sex, test;
}s[MAXN];
struct noded {int date, sh, sm, ss, th, tm, ts, a, b, s;double l;noded() {sh = sm = ss = th = tm = ts = 0;}
}doc[MAXM];
vector < int > G[MAXN];
map < int, int > mp;
int n, m, ans;
int day[15];int Run( char sex, int t ) {if( sex == 'M' ) {if( t <= 1230 ) return 20;if( t <= 1300 ) return 18;if( t <= 1330 ) return 16;if( t <= 1400 ) return 14;if( t <= 1430 ) return 12;if( t <= 1510 ) return 10;if( t <= 1550 ) return 8;if( t <= 1630 ) return 6;if( t <= 1710 ) return 4; if( t <= 1800 ) return 2;}else {if( t <= 640 ) return 20;if( t <= 657 ) return 18;if( t <= 714 ) return 16;if( t <= 731 ) return 14;if( t <= 750 ) return 12;if( t <= 805 ) return 10;if( t <= 820 ) return 8;if( t <= 835 ) return 6;if( t <= 850 ) return 4;if( t <= 900 ) return 2;}return 0;
}void init() {day[1] = day[3] = day[5] = day[7] = day[8] = day[10] = day[12] = 31;day[2] = 28;day[4] = day[6] = day[9] = day[11] = 30;
}int Date( int s, int t ) {int sm = ( s % 10000 ) / 100, sd = s % 100;int tm = ( t % 10000 ) / 100, td = t % 100;int sums = sd, sumt = td;for( int i = 1;i < sm;i ++ )sums += day[i];for( int i = 1;i < tm;i ++ )sumt += day[i];return sumt - sums;
}int Time( int i ) {int sh = doc[i].sh, sm = doc[i].sm, ss = doc[i].ss;int th = doc[i].th, tm = doc[i].tm, ts = doc[i].ts;if( sh > th ) th += 24;return th * 3600 + tm * 60 + ts - sh * 3600 - sm * 60 - ss;
}int Time( int i, int j ) {int sh = doc[i].th, sm = doc[i].tm, ss = doc[i].ts;int th = doc[j].sh, tm = doc[j].sm, ts = doc[j].ss;int date = Date( doc[i].date, doc[j].date );th += date * 24;if( th < sh ) return 0;return th * 3600 + tm * 60 + ts - sh * 3600 - sm * 60 - ss;
}int shine( int u ) {int tot = 0, last = 0;for( int v = 0;v < G[u].size();v ++ ) {int i = G[u][v];doc[i].l *= 1000;if( doc[i].l < 3000 && s[u].sex == 'M' ) continue;if( doc[i].l < 1500 && s[u].sex == 'F' ) continue;if( doc[i].l / Time( i ) < 2 || doc[i].l / Time( i ) > 5 ) continue;if( doc[i].a * 60 + doc[i].b > 270 ) continue;if( doc[i].l / doc[i].s > 1.5 ) continue;if( Time( last, i ) < 21600 ) continue;tot ++, last = i;}return tot;
}int SunRun( int x ) {if( x >= 21 ) return 10;if( x >= 19 ) return 9;if( x >= 17 ) return 8;if( x >= 14 ) return 7;if( x >= 11 ) return 6;if( x >= 7 ) return 4;if( x >= 3 ) return 2;return 0;
}int Item( int x ) {if( x >= 18 ) return 5;if( x >= 15 ) return 4;if( x >= 12 ) return 3;if( x >= 9 ) return 2;if( x >= 6 ) return 1;return 0;
}void Grade( int x ) {if( x >= 95 ) printf( "A\n" );else if( x >= 90 ) printf( "A-\n" );else if( x >= 85 ) printf( "B+\n" );else if( x >= 80 ) printf( "B\n" );else if( x >= 77 ) printf( "B-\n" );else if( x >= 73 ) printf( "C+\n" );else if( x >= 70 ) printf( "C\n" );else if( x >= 67 ) printf( "C-\n" );else if( x >= 63 ) printf( "D+\n" );else if( x >= 60 ) printf( "D\n" );else printf( "F\n" );
}signed main() {init();scanf( "%lld", &n );for( int i = 1;i <= n;i ++ ) {char pun;scanf( "%lld %c %lld %lld%c%lld%c %c %lld %lld", &s[i].id, &s[i].sex, &s[i].s, &s[i].a, &pun, &s[i].b, &pun, &s[i].test, &s[i].f, &s[i].c );ans = 0;ans += s[i].s;ans += Run( s[i].sex, s[i].a * 100 + s[i].b );if( s[i].test == 'P' ) ans += 10;s[i].ans = ans;mp[s[i].id] = i;}scanf( "%lld", &m );for( int i = 1, id;i <= m;i ++ ) {char pun;scanf( "%lld %lld %lld:%lld:%lld %lld:%lld:%lld %lf %lld%c%lld%c %lld", &doc[i].date, &id, &doc[i].sh, &doc[i].sm, &doc[i].ss, &doc[i].th, &doc[i].tm, &doc[i].ts, &doc[i].l, &doc[i].a, &pun, &doc[i].b, &pun, &doc[i].s );G[mp[id]].push_back( i );}for( int i = 1;i <= n;i ++ ) {int tot = shine( i );s[i].ans += SunRun( tot );s[i].ans += Item( tot + s[i].c ) + s[i].f;}for( int i = 1;i <= n;i ++ )printf( "%lld %lld ", s[i].id, s[i].ans ), Grade( s[i].ans );return 0;
}