QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#787837#9807. Make Them Believeericmegalovania#WA 0ms3652kbC++201.2kb2024-11-27 14:52:072024-11-27 14:52:09

Judging History

你现在查看的是最新测评结果

  • [2024-11-27 14:52:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-11-27 14:52:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

//#define ONLINE
#ifndef ONLINE
char DEBUG_BUFFER[1000];
#define debug(...) {sprintf(DEBUG_BUFFER,##__VA_ARGS__);\
cerr<<"\033[1;36m"<<DEBUG_BUFFER<<"\033[0;2m"<<"\033[0m";}
#else
#define debug(...) ;
#endif

using LL=long long;
using PII=pair<int,int>;

#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()

#define FAST_IO {ios::sync_with_stdio(false);cin.tie(nullptr);}
inline int read(){static int x; cin>>x; return x;}
inline LL readLL(){static LL x; cin>>x; return x;}
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

string s[8];
int t[8];

int main(){
	FAST_IO;
	for(int i=0;i<8;i++){
		cin>>s[i]>>t[i];
	}
	vector<int>a(8);
	iota(all(a),0);
	while(a.size()>2){
		vector<int>b;
		for(int i=0;i<a.size();i+=2){
			b.push_back(t[a[i]]>t[a[i+1]]?a[i]:a[i+1]);
		}
		swap(a,b);
	}
	if(t[a[0]]<t[a[1]]) swap(a[0],a[1]);
	cout<<s[a[0]]<<" betas "<<s[a[1]];
	return 0;
}

/* stuff you should look for
* int overflow, array bounds
* special cases (n=1?)
* do smth instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3652kb

input:

LNG 55
WBG 65
HLE 70
BLG 75
TES 48
T1 80
GEN 60
FLY 50

output:

T1 betas BLG

result:

wrong answer 2nd words differ - expected: 'beats', found: 'betas'