답안 #49769

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
49769 2018-06-03T00:57:46 Z mra2322001 생물 실험 (IZhO13_expgorl) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define f0(i, n) for(int i(0); i<(n); i++)
#define f1(i, n) for(int i(1); i<=(n); i++)
#define mu2(x) ((x)*(x))

using namespace std;
typedef long long ll;
const int N = 1e4 + 4;

int n, k, x1, y1, g1, g2;
string s;

double dist(int x2, int y2, int x3, int y3){
    int g = mu2(x3 - x2) + mu2(y3 - y2);
    return sqrt((double)g);
}

int main(){
    ios_base::sync_with_stdio(0);

    cin >> k; cin >> s;
    n = s.length();
    /*cin >> x1 >> y1 >> g1 >> g2;
    if(n <= 2000 && k <= 20000){
        double mi = 2e9, ma = 0;
        ma = max(ma, dist(x1, y1, g1, g2));
        mi = min(mi, dist(x1, x1, g1, g2));
        for(int i = 0; i < n*k; i++){
            int u = i%n;
            if(s[u]=='L') --g1;
            if(s[u]=='R') ++g1;
            if(s[u]=='F') ++g2;
            if(s[u]=='B') --g2;
             ma = max(ma, dist(x1, y1, g1, g2));
            mi = min(mi, dist(x1, x1, g1, g2));
        }
        cout << fixed << setprecision(10) << mi << " " << ma;
    }*/
}

Compilation message

expgorl.cpp:10:15: error: 'int y1' redeclared as different kind of symbol
 int n, k, x1, y1, g1, g2;
               ^~
In file included from /usr/include/features.h:367:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
                 from /usr/include/c++/7/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from expgorl.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:251:1: note: previous declaration 'double y1(double)'
 __MATHCALL (y1,, (_Mdouble_));
 ^