QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#558907#8835. GoodmanlntanoCompile Error//C++14500b2024-09-11 19:16:072024-09-11 19:16:13

Judging History

你现在查看的是最新测评结果

  • [2024-09-11 19:16:13]
  • 评测
  • [2024-09-11 19:16:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
ll num[2020200],f[2020200];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll t,n;
	cin>>t;
	while(t--){
		cin>>n;
		vector<ll> a;
		for(int i=1;i<=n;i++){
			f[i]=0;
			cin>>num[i];
		}
		for(int i=1;i<=n;i++){
			if(f[i]) continue;
			ll temp=i;
			while(!f[temp]){
				a.push_back(temp);
				f[temp]=1;
				temp=num[temp];
			}
		}
		for(auto it:a){
			cout<<it<<" ";
		}
		cout<<'\n';
	} 
	return 0;
}

詳細信息

answer.code:3:1: error: ‘ll’ does not name a type
    3 | ll num[2020200],f[2020200];
      | ^~
answer.code: In function ‘int main()’:
answer.code:8:9: error: ‘ll’ was not declared in this scope
    8 |         ll t,n;
      |         ^~
answer.code:9:14: error: ‘t’ was not declared in this scope; did you mean ‘tm’?
    9 |         cin>>t;
      |              ^
      |              tm
answer.code:11:22: error: ‘n’ was not declared in this scope; did you mean ‘yn’?
   11 |                 cin>>n;
      |                      ^
      |                      yn
answer.code:12:26: error: template argument 2 is invalid
   12 |                 vector<ll> a;
      |                          ^
answer.code:14:25: error: ‘f’ was not declared in this scope
   14 |                         f[i]=0;
      |                         ^
answer.code:15:30: error: ‘num’ was not declared in this scope; did you mean ‘enum’?
   15 |                         cin>>num[i];
      |                              ^~~
      |                              enum
answer.code:18:28: error: ‘f’ was not declared in this scope
   18 |                         if(f[i]) continue;
      |                            ^
answer.code:19:27: error: expected ‘;’ before ‘temp’
   19 |                         ll temp=i;
      |                           ^~~~~
      |                           ;
answer.code:20:32: error: ‘f’ was not declared in this scope
   20 |                         while(!f[temp]){
      |                                ^
answer.code:20:34: error: ‘temp’ was not declared in this scope; did you mean ‘tm’?
   20 |                         while(!f[temp]){
      |                                  ^~~~
      |                                  tm
answer.code:21:35: error: request for member ‘push_back’ in ‘a’, which is of non-class type ‘int’
   21 |                                 a.push_back(temp);
      |                                   ^~~~~~~~~
answer.code:23:38: error: ‘num’ was not declared in this scope; did you mean ‘enum’?
   23 |                                 temp=num[temp];
      |                                      ^~~
      |                                      enum
answer.code:26:29: error: ‘begin’ was not declared in this scope; did you mean ‘std::begin’?
   26 |                 for(auto it:a){
      |                             ^
      |                             std::begin
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:166,
                 from answer.code:1:
/usr/include/c++/13/valarray:1232:5: note: ‘std::begin’ declared here
 1232 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
answer.code:26:29: error: ‘end’ was not declared in this scope; did you mean ‘std::end’?
   26 |                 for(auto it:a){
      |                             ^
      |                             std::end
/usr/include/c++/13/valarray:1259:5: note: ‘std::end’ declared here
 1259 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~