萌新求助spj
  • 板块灌水区
  • 楼主wocaicai
  • 当前回复9
  • 已保存回复9
  • 发布时间2020/11/17 20:44
  • 上次更新2023/11/5 07:49:21
查看原帖
萌新求助spj
246800
wocaicai楼主2020/11/17 20:44

rt 这是一道题的spj , 第一行数是一个n,第二行一个数m,第三行包含m个数

请问我的spj有什么问题qwq

#include "testlib.h"
#include<bits/stdc++.h>
using namespace std ; 
#define ll long long 
int n , m ; 
ll tans , wans; 
const int maxn = 200020 ; 
int xi[maxn] , hi[maxn] ; 
int main(int argc , char* argv[]){
	registerTestlibCmd(argc, argv); 
	n = inf.readInt() ; 
	inf.readEoln() ;  
	for(int i = 1 ; i <= n ; i++){
		hi[i] = inf.readInt() ; 
		xi[i] = inf.readInt() ; 
		inf.readEoln() ; 
	}
	tans = ans.readLong() ; 
	wans = ouf.readLong() ; 
	if(tans != wans){
		quitf(_wa , "your ans is wrong !") ; 
	}
	ouf.readEoln() ; 
	int num = ouf.readInt() ; 
	wans = 0 ; int nowmax = 0 , numid = 0 ; 
	ouf.readEoln() ;  
	for(int i = 1 ; i <= num ; i++){
		int now = ouf.readInt() ; 
		wans += hi[now] ; 
		if(nowmax >= xi[now] || numid >= now )
			quitf(_pc(0.5) , "your ans is right but your chooses are wrong !") ; 
		nowmax = xi[now] ; 
		numid = now ; 
	}
	if(wans == tans)
	quitf(_ok , "your ans is right !") ; 
	else quitf(_pc(0.5) , "your ans is right but your chooses are wrong !") ; 
} 

题面在这里

2020/11/17 20:44
加载中...