c++ - 某些在线 ide 中出现 SIGTSTP 错误,但程序在我的终端中运行良好
问题描述
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,n;
cin>>t;
for(int i=1;i<=t;i++)
{
int c=0;int C[t]={};
cin>>n;
int P[n]={};int G[n]={};
for(int j=0;j<n;j++)
{
cin>>P[j];
}
for(int k=0;k<n;k++)
{
int asn=1;int b=5;
if(k!=0)
{
if(k<5)
{
for(int l=0;l<k;l++)
{
if(P[l]<P[k])
{
asn*=0;
}
}
}
else
{
while(b>0)
{
if(P[k-b]<P[k])
{
asn*=0;
}
b--;
}
}
}
G[k]=asn;
}
for(int f=0;f<n;f++)
{
if(G[f]==1)
{
c++;
}
}
cout<<c<<"\n";
}
}
谁能帮我找出这段代码中的 SIGTSTP 错误。在我的电脑中,这个程序运行良好,但在 Codechef 的在线 IDE 中编译时出现运行时错误。问题的链接是https://www.codechef.com/OCT19B/problems/S10E
解决方案
推荐阅读
- awk - awk / gawk printf 可变格式字符串时,将零更改为破折号
- html - 日期选择器和时间选择器应该分开
- swift - 从 Swift 中的 Firebase 实时数据库获取当前服务器时间
- c# - 如何转换为传递给函数的类型?
- c# - 警告:源文档中没有元素匹配 '/configuration/connectionStrings/add[@name='MyDB']'
- javascript - Angular - 如何访问注释类方法
- ruby-on-rails - 无法将 Ruby 应用程序部署到 Heroku
- mysql - 从 Magento 1.9 数据库中获取客户姓名、电子邮件和电话号码
- android - 捕获图像后应用程序关闭且图像未存储到 Firebase
- c# - ASP.NET MVC 访问被拒绝(检索具有 CLSID 的组件的 COM 类工厂)