社区讨论

30分求助,只对subtask2

P8964梦幻 | Reopening of Dream参与者 4已保存回复 8

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
8 条
当前快照
1 份
快照标识符
@lo39w8ed
此快照首次捕获于
2023/10/24 03:10
2 年前
此快照最后确认于
2023/10/24 03:10
2 年前
查看原帖
CPP
#include<iostream>
#include<string>
using namespace std;
string ptr[10],ptw[10];
int main(){
    int IAKIOIFUCKCCF;
    cin>>IAKIOIFUCKCCF;
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        string t;
        cin>>t;
        ptr[i]="freopen(\""+t+".in\",\"r\",stdin);";
        ptw[i]="freopen(\""+t+".out\",\"w\",stdout);";
    }
    for(int i=1;i<=n;i++){
        int putong=1,jianzuzong=0,lezi=0;
        for(int j=1;j<=m;j++){
            string sr,sw;
            cin>>sr>>sw;
            //cout<<sr<<" "<<ptr[j];
            //cout<<sr.substr(0,10);
            if((sr.substr(0,10)=="//freopen("&&sr[sr.size()-2]==')'&&sr[sr.size()-1]==';')||(sw.substr(0,10)=="//freopen"&&sw[sw.size()-2]==')'&&sw[sw.size()-1]==';')){
                putong=0;
                jianzuzong=1;
                break;
            }else if(!(sr==ptr[j]&&sw==ptw[j])){
                putong=0;
                lezi=1;
                //break;
            }
        }
        if(putong==1){
            cout<<"PION2202 RP++.\n";
        }else if(jianzuzong==1){
            cout<<"Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI.\n";
        }else if(lezi==1){
            cout<<"Good luck and have fun.\n";
        }
    }
    return 0;
}

回复

8 条回复,欢迎继续交流。

正在加载回复...