QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#809212 | #9871. Just another Sorting Problem | 3343156983 | Compile Error | / | / | C++14 | 656b | 2024-12-11 13:17:38 | 2024-12-11 13:17:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
string x;
cin>>n>>x;
int sum=0;
vector<int> a(n+1)
for(int i=1;i<=n;i++){
int y;
cin>>y;
a[i]=y;
if(y!=i) sum++;
}
if(n==2){
cout<<"Alice"<<endl;
}
else if(n==3&&sum==3&&a[1]==2&&a[2]==3&&a[3]==1){
cout<<"Alice"<<endl;
}
else if(sum<=2&&x=="Alice"){
cout<<"Alice"<<endl;
}else{
cout<<"Bob"<<endl;
}
}
}
詳細信息
answer.code: In function ‘int main()’: answer.code:12:9: error: expected ‘,’ or ‘;’ before ‘for’ 12 | for(int i=1;i<=n;i++){ | ^~~ answer.code:12:21: error: ‘i’ was not declared in this scope 12 | for(int i=1;i<=n;i++){ | ^