30分求助,只对subtask2
查看原帖
30分求助,只对subtask2
616964
Adolfo_North楼主2023/1/24 21:09
#include<iostream>
#include<string>
using namespace std;
string a[10];
int main(){
    string t,t2;
    int T,n,m;
    cin>>T>>n>>m;
    for(int i=1;i<=m;i++){
        cin>>t;
        a[i*2-1]="freopen(\""+t+".in\",\"r\",stdin);";
        a[i*2]="freopen(\""+t+".out\",\"w\",stdout);";
    }
    for(int i=1;i<=n;i++){
        int f=1;
        for(int j=1;j<=m;j++){
            cin>>t>>t2;
            if(f==1){
                if((t.substr(0,10)=="//freopen("&&t[t2.size()-2]==')'&&t[t2.size()-1]==';')||(t2.substr(0,10)=="//freopen("&&t2[t2.size()-2]==')'&&t2[t2.size()-1]==';'))f=2;
                else if(!(t==a[j*2-1]&&t2==a[j*2]))f=3;
            }
        }
        if(f==1) cout<<"PION2202 RP++.\n";
        else if(f==2) cout<<"Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI.\n";
        else if(f==3) cout<<"Good luck and have fun.\n";
    }
    return 0;
}
2023/1/24 21:09
加载中...