G++编译后无法运行
  • 板块学术版
  • 楼主wzzzh
  • 当前回复7
  • 已保存回复7
  • 发布时间2023/2/4 22:48
  • 上次更新2023/10/24 01:40:35
查看原帖
G++编译后无法运行
125428
wzzzh楼主2023/2/4 22:48

RT. 今天在写题的时候,发现正常编译的程序突然无法运行(如图),请各位大佬帮忙看看是什么原因? 附代码:

#include<iostream>
#include<string>
std::string s;
char c1[10005][100005];
char c2[10005][100005];
long long cnt;
long long to_int(double __x){
    long long tmp=__x;
    if(tmp+0.5>=__x){
        return tmp+1;
    }
    return tmp;
}
int main(){
    freopen("P5587.in","r",stdin);
    freopen("P5587.out","w",stdout);
    for(int i=1;;i++){
        std::getline(std::cin,s);
        if(s=="EOF"){
            break;
        }
        int now=0;
        for(auto c:s){
            if(c=='<'){
                if(now>0){
                    now--;
                    c1[i][now]=0;
                }
                continue;
            }
            c1[i][now]=c;
            now++;
        }
    }
    for(int i=1;;i++){
        std::getline(std::cin,s);
        if(s=="EOF"){
            break;
        }
        int now=0;
        for(auto c:s){
            if(c=='<'){
                if(now>0){
                    now--;
                    c2[i][now]=0;
                }
                continue;
            }
            c2[i][now]=c;
            now++;
        }
        for(int j=0;c1[i][j]!=0;j++){
            if(c1[i][j]==c2[i][j]){
                cnt++;
            }
        }
    }
    double t;
    std::cin>>t;
    std::cout<<to_int(60*cnt/t)<<std::endl;
    return 0;
}
2023/2/4 22:48
加载中...