样例过了但是只有0pts,求一组hack数据
查看原帖
样例过了但是只有0pts,求一组hack数据
427120
KS_tips_CN楼主2022/5/22 14:59

这里是代码

//------------------------
//Online Judge : Luogu
//By : KS_tips_CN
//Subject :
//------------------------
//#include<bits/stdc++.h>
//#include<map>
//#include<stack>
//#include<list>
//#include<set>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<queue>
#include<algorithm>
#include<vector>
#define ll long long
#define reg register int
#define gc getchar()
#define MAXN 200
#define MOD

using namespace std;
inline ll read( void ) ;

struct per{
	string name;
	ll poi,value,ex,xh;
}p[MAXN];
int n;
inline bool cmp1( per a , per b ){
	if( a.value != b.value ) return a.value > b.value ;
	else return a.xh < b.xh ;
}
inline bool cmp2( per a , per b ){
	if( a.poi != b.poi ) return a.poi > b.poi ;
	else if( a.ex != b.ex ) return a.ex > b.ex ;
	else return a.xh < b.xh ;
}

int main( void ) {

	n = read();
	string s ;
	for( reg i = 1 ; i <= n ; i++ ){
		
		p[i].xh = i;
		cin >> p[i].name >> s ;
		if( s == "BangZhu" ) p[i].poi = 7;
		else if( s == "FuBangZhu" ) p[i].poi = 6;
		else if( s == "HuFa" ) p[i].poi = 5;
		else if( s == "ZhangLao" ) p[i].poi = 4;
		else if( s == "TangZhu" ) p[i].poi = 3;
		else if( s == "JingYing" )p[i].poi = 2;
		p[i].value = read();
		p[i].ex = read();
		
	}
	cout << endl;
	//现在我们已经存好了所有玩家的所有资料
	sort(p+1,p+1+n,cmp1); 
	//现在已经将所有玩家按照帮贡进行排序了
	int qwe = 0;
	for( reg i = 1 ; i <= n ; i++ ){
		if( p[i].poi >= 6 ) continue;
		//跳过帮主和副帮主
		qwe++;
		if( qwe <= 2 ) p[i].poi = 5 ;
		else if( qwe <= 6 ) p[i].poi = 4;
		else if( qwe <= 13 ) p[i].poi = 3;
		else if( qwe <= 28 ) p[i].poi = 2;
		
	} 
	sort( p+1,p+1+n,cmp2);
	for( reg i = 1 ; i <= n ; i++ ){
		cout << p[i].name << ' ';
		if( p[i].poi == 7 ) printf("BangZhu ");
		else if( p[i].poi == 6 ) printf("FuBangZhu ");
		else if( p[i].poi == 5 ) printf("HuFa ");
		else if( p[i].poi == 4 ) printf("ZhangLao ");
		else if( p[i].poi == 3 ) printf("TangZhu ");
		else if( p[i].poi == 2 ) printf("JingYing ");
		cout << p[i].ex << endl ;
	}
	return 0;
}

inline ll read( void ) {
	ll x = 0 , f = 0 ;
   	char ch = gc ;
   	while( !isdigit( ch ) )
    	f |= ( ch == '-' ) , ch = gc ;
   	while( isdigit( ch ) )
    	x = ( x << 1 ) + ( x << 3 ) + ( ch ^ 48 ) , ch = gc ;
    return f ? -x : x ;
}

2022/5/22 14:59
加载中...