Submission #00066
ソースコード
ステータス
項目 |
データ |
問題 |
0003 - あいさつまわり |
ユーザー名 |
ei2205
|
投稿日時 |
2022-08-15 09:47:15 |
言語 |
C++17 |
状態 |
Compile Error |
得点 |
0
|
ソースコード長 |
541 Byte |
最大実行時間 |
-
|
最大メモリ使用量 |
|
コンパイルメッセージ
./Main.cpp: In function ‘int main()’:
./Main.cpp:9:19: error: conflicting declaration ‘std::vector<int> x’
vector<int> x(n-1,0);
^
./Main.cpp:6:13: note: previous declaration as ‘int x’
int n,i,x,home;
^
./Main.cpp:11:17: error: invalid types ‘int[int]’ for array subscript
cin>>x[i];
^
./Main.cpp:13:12: error: request for member ‘begin’ in ‘x’, which is of non-class type ‘int’
sort(x.begin(),x.end());
^~~~~
./Main.cpp:13:22: error: request for member ‘end’ in ‘x’, which is of non-class type ‘int’
sort(x.begin(),x.end());
^~~
./Main.cpp:14:16: error: invalid types ‘int[int]’ for array subscript
if(home<x[0]){
^
./Main.cpp:15:20: error: invalid types ‘int[int]’ for array subscript
cout<<x[n-2]<<"\n";
^
./Main.cpp:16:24: error: invalid types ‘int[int]’ for array subscript
}else if(home>x[n-2]){
^
./Main.cpp:17:20: error: invalid types ‘int[int]’ for array subscript
cout<<x[n-2]<<"\n";
^
./Main.cpp:18:22: error: invalid types ‘int[int]’ for array subscript
}else if(home-x[0]<=x[n-2]-home){
^
./Main.cpp:18:30: error: invalid types ‘int[int]’ for array subscript
}else if(home-x[0]<=x[n-2]-home){
^
./Main.cpp:19:25: error: invalid types ‘int[int]’ for array subscript
cout<<((home-x[0])/2)+(x[n-2]-home)<<"\n";
^
./Main.cpp:19:37: error: invalid types ‘int[int]’ for array subscript
cout<<((home-x[0])/2)+(x[n-2]-home)<<"\n";
^
./Main.cpp:21:22: error: invalid types ‘int[int]’ for array subscript
cout<<((x[n-2]-home)/2)+(home-x[0])<<"\n";
^
./Main.cpp:21:42: error: invalid types ‘int[int]’ for array subscript
cout<<((x[n-2]-home)/2)+(home-x[0])<<"\n";
^
セット
テストケース