QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#133626 | #4935. Exchange Bottleneck | nameless_story# | Compile Error | / | / | C++14 | 663b | 2023-08-02 12:08:45 | 2023-08-02 12:09:04 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-08-02 12:09:04]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-08-02 12:08:45]
- 提交
answer
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(),(x).end()
int main()
{
ios::sync_with_stdio(0);cin.tie(0);
int n;
cin>>n;
vector a(n+1,0);
for(int i=2;i<=n;i++)
cin>>a[i];
int tp=2;
for(int i=n;i>2;i--)
if(a[i])
{
tp=i;
break;
}
if(tp==2)
{
cout<<n-1<<'\n';
return 0;
}
if(tp<n)
{
cout<<n-tp+1<<'\n';
return 0;
}
if(*min_element(a.begin()+3,a.end())==0)
cout<<2<<'\n';
else
cout<<1<<'\n';
}
详细
answer.code: In function ‘int main()’: answer.code:14:12: error: missing template arguments before ‘a’ 14 | vector a(n+1,0); | ^ answer.code:16:10: error: ‘a’ was not declared in this scope 16 | cin>>a[i]; | ^ answer.code:19:8: error: ‘a’ was not declared in this scope 19 | if(a[i]) | ^ answer.code:34:21: error: ‘a’ was not declared in this scope 34 | if(*min_element(a.begin()+3,a.end())==0) | ^