关于8964,目前30分。蒟蒻求调。
查看原帖
关于8964,目前30分。蒟蒻求调。
712061
PPDD_I3PP_PPSSDD楼主2023/8/12 20:24

8964怎么回事。

提交记录

代码查了45分钟都没能看出个名堂。

悬赏1关注。

code:

#include<bits/stdc++.h>
using namespace std;
string names[5];
bool ok(string a) {
	if(a.size()<12) return 0;
	if(a[0]=='/'&&a[1]=='/'&&a[2]=='f'&&a[3]=='r'&&a[4]=='e'&&a[5]=='o'
	        &&a[6]=='p'&&a[7]=='e'&&a[8]=='n'&&a[9]=='('
	        &&a[a.size()-2]==')'&&a[a.size()-1]==';')
		return 1;
	return 0;
}
int main() {
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	string la="freopen(\"",ra=".in\",\"r\",stdin);";
	string lb="freopen(\"",rb=".out\",\"w\",stdout);";
	int n,m;
	cin>>n>>n>>m;
	for(int i=1; i<=m; i++) cin>>names[i];
	for(int i=1; i<=n; i++) {
		bool okr=0,okh=0;
		for(int j=1; j<=m; j++) {
			string a,b;
			cin>>a>>b;
			string stda=la+names[j]+ra,stdb=lb+names[j]+rb;
			if(a==stda&&b==stdb) continue;
			if(ok(a)&&ok(b)) okr=1;
			else okh=1;
		}
		if(okr) cout<<"Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI."<<endl;
		else if(okh) cout<<"Good luck and have fun."<<endl;
		else cout<<"PION2202 RP++."<<endl;
	}
	return 0;
}
2023/8/12 20:24
加载中...