/ Vijos /

记录详情

Compile Error

foo.cpp:15:26: error: 'int y1' redeclared as different kind of symbol
 int n, m, tot, x, y, x1, y1, x2, y2, X[maxn], Y[maxn], f[maxn];
                          ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:3:
c:\mingw\include\math.h:263:24: error: previous declaration of 'double y1(double)'
 _CRTIMP double __cdecl y1 (double);
                        ^
foo.cpp: In function 'int main()':
foo.cpp:42:6: error: assignment of function 'double y1(double)'
   y1 = M[y << 1];
      ^
foo.cpp:42:6: error: cannot convert 'std::map<int, int>::mapped_type {aka int}' to 'double(double)' in assignment
foo.cpp:46:27: error: invalid conversion from 'double (__attribute__((__cdecl__)) *)(double)' to 'int' [-fpermissive]
    if (find(x1) == find(y1) || find(x2) == find(y2)) {
                           ^
foo.cpp:17:5: error:   initializing argument 1 of 'int find(int)' [-fpermissive]
 int find(int x) {
     ^
foo.cpp:50:35: error: invalid conversion from 'double (__attribute__((__cdecl__)) *)(double)' to 'int' [-fpermissive]
    combine(x1, y2); combine(x2, y1);
                                   ^
foo.cpp:20:13: error:   initializing argument 2 of 'void combine(int, int)' [-fpermissive]
 inline void combine(int x, int y) {
             ^
foo.cpp:52:51: error: invalid conversion from 'double (__attribute__((__cdecl__)) *)(double)' to 'int' [-fpermissive]
    if (find(x1) == find(y2) || find(x2) == find(y1)) {
                                                   ^
foo.cpp:17:5: error:   initializing argument 1 of 'int find(int)' [-fpermissive]
 int find(int x) {
     ^
foo.cpp:56:18: error: invalid conversion from 'double (__attribute__((__cdecl__)) *)(double)' to 'int' [-fpermissive]
    combine(x1, y1); combine(x2, y2);
                  ^
foo.cpp:20:13: error:   initializing argument 2 of 'void combine(int, int)' [-fpermissive]
 inline void combine(int x, int y) {
             ^

信息

递交者
类型
递交
题目
P1112 小胖的奇偶
语言
C++
递交时间
2016-11-07 17:32:21
评测时间
2016-11-07 17:32:22
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes