제출 #132594

#제출 시각아이디문제언어결과실행 시간메모리
132594anaykDojave (COCI17_dojave)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #define MAXN 2000000 int m, n; int first[MAXN]; int other[MAXN]; int seq[MAXN]; long long dp[2][MAXN]; int min, max; int a, b; void add(int x) { min = std::min(x, min); max = std::max(x, max); } void solve(int l, int r) { int m = (l+r)/2; a = m; b = m+1; min = a; max = b; add(other[seq[a]]); add(other[seq[b]]); while(true) { if(a > min) { if(a == l) break; a--; add(other[seq[a]]); } else if(b < max) { if(b == r) break; b++; add(other[seq[b]]); } else { first[a] = std::min(first[a], b); if(a == l) break; a--; add(other[seq[a]]); } } } int main() { std::ios::sync_with_stdio(false);  std::cin.tie(NULL); std::cin >> m; n = (1 << m); for(int i = 0; i < n; i++) { std::cin >> seq[i]; first[i] = MAXN; other[seq[i]^(n-1)] = i; }    if(m == 1)    {       std::cout << 1;       return 0;    } int c = 2; while(c <= n) { for(int i = 0; i < n; i+=c) solve(i, i+c-1); c *= 2; } long long answer = n; answer *= (answer-1); answer /= 2; answer += (long long) n; dp[0][n] = dp[1][n] = 0; for(int i = n-1; i >= 0; i--) { dp[0][i] = dp[1][i] = 0; if(first[i] == MAXN) continue; int c = first[i]-i+1; if(c%4) { dp[1][i] = 1; dp[1][i] += dp[0][first[i]+1]; dp[0][i] += dp[1][first[i]+1]; } else { dp[0][i] = 1; dp[1][i] += dp[1][first[i]+1]; dp[0][i] += dp[0][first[i]+1]; } answer -= dp[0][i]; } std::cout << answer << std::endl; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

dojave.cpp:66:2: error: stray '\302' in program
   std::cin.tie(NULL);
  ^
dojave.cpp:66:3: error: stray '\240' in program
   std::cin.tie(NULL);
   ^
dojave.cpp:78:2: error: stray '\302' in program
     if(m == 1)
  ^
dojave.cpp:78:3: error: stray '\240' in program
     if(m == 1)
   ^
dojave.cpp:78:5: error: stray '\302' in program
     if(m == 1)
     ^
dojave.cpp:78:6: error: stray '\240' in program
     if(m == 1)
      ^
dojave.cpp:79:2: error: stray '\302' in program
     {
  ^
dojave.cpp:79:3: error: stray '\240' in program
     {
   ^
dojave.cpp:79:5: error: stray '\302' in program
     {
     ^
dojave.cpp:79:6: error: stray '\240' in program
     {
      ^
dojave.cpp:80:2: error: stray '\302' in program
        std::cout << 1;
  ^
dojave.cpp:80:3: error: stray '\240' in program
        std::cout << 1;
   ^
dojave.cpp:80:5: error: stray '\302' in program
        std::cout << 1;
     ^
dojave.cpp:80:6: error: stray '\240' in program
        std::cout << 1;
      ^
dojave.cpp:80:8: error: stray '\302' in program
        std::cout << 1;
        ^
dojave.cpp:80:9: error: stray '\240' in program
        std::cout << 1;
         ^
dojave.cpp:81:2: error: stray '\302' in program
        return 0;
  ^
dojave.cpp:81:3: error: stray '\240' in program
        return 0;
   ^
dojave.cpp:81:5: error: stray '\302' in program
        return 0;
     ^
dojave.cpp:81:6: error: stray '\240' in program
        return 0;
      ^
dojave.cpp:81:8: error: stray '\302' in program
        return 0;
        ^
dojave.cpp:81:9: error: stray '\240' in program
        return 0;
         ^
dojave.cpp:82:2: error: stray '\302' in program
     }
  ^
dojave.cpp:82:3: error: stray '\240' in program
     }
   ^
dojave.cpp:82:5: error: stray '\302' in program
     }
     ^
dojave.cpp:82:6: error: stray '\240' in program
     }
      ^