div2A 30pts求调
  • 板块学术版
  • 楼主MornStar
  • 当前回复5
  • 已保存回复5
  • 发布时间2023/1/24 18:17
  • 上次更新2023/10/24 03:11:08
查看原帖
div2A 30pts求调
760824
MornStar楼主2023/1/24 18:17

提交记录

#include<bits/stdc++.h>
using namespace std;
string tin[5],tout[5];
int f;
int main(){
	ios::sync_with_stdio(false);
	int t,n,m;
	cin>>t>>n>>m;
	for(int i=1;i<=m;i++){
		string s;
		cin>>s;
		tin[i]="freopen(\""+s+".in\",\"r\",stdin);";
		tout[i]="freopen(\""+s+".out\",\"w\",stdout);";
	}
	for(int i=1;i<=n;i++){
		f=1;
		for(int j=1;j<=m;j++){
			string si,so;
			cin>>si>>so;
			if(si!=tin[j]&&f==1){
				if(si.substr(0,10)=="//freopen("&&si.find(");")!=-1){
					f=2;
				}else{
					f=3;
				}
			}
			if(so!=tout[j]&&f==1){
				if(so.substr(0,10)=="//freopen("&&so.find(");")!=-1){
					f=2;
				}else{
					f=3;
				}
			}
		}
		if(f==1){
			cout<<"PION2202 RP++."<<endl;
		}else if(f==2){
			cout<<"Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI."<<endl;
		}else{
			cout<<"Good luck and have fun."<<endl;
		}
	}
}
2023/1/24 18:17
加载中...