Submission #32092

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
320922017-09-25 01:30:43h0ngjun7씽크스몰 (kriii3_TT)C++14
Compilation error
0 ms0 KiB
#include <stdio.h>
#include <complex>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const double M_PI = 3.1415926535897932384626433832795;
namespace FFT {
typedef complex<double> base;
void FFT(vector <base> &v, bool inv) {
vector<base> w(v.size());
for (int i = 0; i < v.size(); i++) {
int k = i&-i;
if (i == k) {
double ang = 2 * M_PI * i / v.size();
if (inv) ang *= -1;
w[i] = base(cos(ang), sin(ang));
}
else w[i] = w[i - k] * w[k];
}
for (int i = 1, j = 0; i < v.size(); i++) {
int bit = v.size() >> 1;
for (; j >= bit; bit >>= 1) j -= bit;
j += bit;
if (i < j) swap(v[i], v[j]);
}
for (int i = 2; i <= v.size(); i <<= 1) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

In file included from /usr/include/c++/5/cmath:44:0,
                 from /usr/include/c++/5/complex:44,
                 from tt.cpp:2:
tt.cpp:9:14: error: expected unqualified-id before numeric constant
 const double M_PI = 3.1415926535897932384626433832795;
              ^
tt.cpp: In function 'void FFT::FFT(std::vector<std::complex<double> >&, bool)':
tt.cpp:15:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < v.size(); i++) {
                     ^
tt.cpp:24:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 1, j = 0; i < v.size(); i++) {
                            ^
tt.cpp:30:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 2; i <= v.size(); i <<= 1) {
                     ^
tt.cpp:31:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int j = 0; j < v.size(); j += i) {
                      ^
tt.cpp:40:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < v.size(); i++) {
                      ^
tt.cpp: In function 'std::vector<long long int> FFT::mul(std::vector<long long int>&, std::vector<long long int>&)':
tt.cpp:48:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while (n < max(v.size(), w.size())) n <<= 1;
            ^
tt.cpp: In function 'std::vector<long long int> FFT::pw(std::vector<long long int>&)':
tt.cpp:63:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while (n < v.size()) n <<= 1;
            ^
tt.cpp: In function 'std::vector<long long int> FFT::mul(std::vector<long long int>&, std::vector<long long int>&, int)':
tt.cpp:75:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while (n < v.size() || n < w.size()) n <<= 1;
            ^
tt.cpp:75:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while (n < v.size() || n < w.size()) n <<= 1;
                            ^
tt.cpp:78:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < v.size(); i++) {
                     ^
tt.cpp:82:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < w.size(); i++) {
                     ^
tt.cpp: In function 'int main()':
tt.cpp:104:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int N, M; scanf("%d%d", &N, &M);
                                 ^
tt.cpp:107:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   ll x; scanf("%lld", &x);
                          ^
tt.cpp:111:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   ll x; scanf("%lld", &x);
                          ^