AtCoder Beginner Contest 002

Submission #1678184

Source codeソースコード

#include "iostream"
#include <string>
using namespace std;
int main() {
	double a[6] ;
	double ans=0;
	a[2] -= a[0];
	a[3] -= a[1];
	a[4] -= a[0];
	a[5] -= a[1];
	ans = abs(a[2] * a[5] - a[3] * a[4]) / 2;
	cout << ans<<endl;
	return(0);
}

Submission

Task問題 C - 直訴
User nameユーザ名 nos_KMC
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 253 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:37: error: call of overloaded ‘abs(double)’ is ambiguous
ans = abs(a[2] * a[5] - a[3] * a[4]) / 2;
^
In file included from /usr/include/c++/5/cstdlib:72:0,
from /usr/include/c++/5/ext/string_conversions.h:41,
from /usr/include/c++/5/bits/basic_string.h:5334,
from /usr/include/c++/5/string:52,
from /usr/include/c++/5/bits/locale_classes.h:40,
from /usr/include/c++/5/bits/ios_base.h:41,
from /usr/include/c++/5/ios:42,
from /usr/include/c++/5/ostream:38,
from /usr/include/c++/5/iostream:39,
from ./Main.cpp:2:
/usr/include/stdlib.h:775:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^
In file included from /usr/include/c++/5/ext/string_conversions.h:41:0,
from /usr/include/c++/5/bits/basic_...

Test case