Language: C++

Last login: Tue Nov 12 10:23:41 on ttys001
matsushitaikkinoMacBook-Pro:~ matsushitaikki$ open .
matsushitaikkinoMacBook-Pro:~ matsushitaikki$ mkdir atcoder
matsushitaikkinoMacBook-Pro:~ matsushitaikki$ cd atcoder/
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 2.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 2.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
6
abaaba 
Yes
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
8
ascdascd
Yes
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
6
abbaba
No
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
4      
rrkrrk
No
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
6
rrkrrk
Yes
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
2
dc
No
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 2.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      L_total += math.sqrt((x[j] - y[i])*(x[j] - y[i]));
                 ^~~~
                 catch
3.cpp:18:18: error: expected expression
2 errors generated.
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      L_total += math.sqrt((x[j] - y[i])*(x[j] - y[i]));
                 ^~~~
                 catch
3.cpp:18:18: error: expected expression
2 errors generated.
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
1matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
0
1
1
1
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
0
0
nan
nan
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
-0
-0
-1
nan
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
3.41421
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
3.cpp:24:32: error: no member named 'factorial' in namespace 'std'
L_total = L_total/(double)std::factorial(N);
                          ~~~~~^
1 error generated.
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
0.569036
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
6.82843
0.569036
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
6.82843
0.758714
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3
0 0
1 0
0 1
13.6569
2.27614
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
2
-879 981
-866 890
91.9239
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
8
-406 10
512 859
494 362
-955 -475
128 553
-986 -885
763 77
449 310
7641.98
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
8
-406 10
512 859
494 362
-955 -475
128 553
-986 -885
763 77
449 310
7641.98178243867
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 3.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
4.cpp:22:10: error: expected ';' at end of declaration
long logn int P_old[1000000];
         ^
         ;
4.cpp:30:29: error: expected ';' after expression
P[j] = P_old[j] + P_old[j-1]
                            ^
                            ;
2 errors generated.
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
Segmentation fault: 11
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
4.cpp:30:29: error: expected ';' after expression
P[j] = P_old[j] + P_old[j-1]i;
                            ^
                            ;
4.cpp:30:29: warning: expression result unused [-Wunused-value]
P[j] = P_old[j] + P_old[j-1]i;
                            ^
1 warning and 1 error generated.
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
0
0
0
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
0
0
0
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
11
0
0
0
0
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
0
0
0
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
5 5
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
1
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
2
2
0
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
0
0
2
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
6 6
0
1
0
0
2
1
0
3
3
0
4
6
6
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ g++ 4.cpp
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ ./a.out
3 3
2
matsushitaikkinoMacBook-Pro:atcoder matsushitaikki$ vi 4.cpp

std::cout << P_old[j] << std::endl;
*/
}

}

N = P_old[x];

if(N>1000000007){
N = N%1000000007;
}


}



std::cout << N << std::endl;


return 0;
}


Compiler output:
a.cc:34:50: warning: multi-character character constant [-Wmultichar]
   34 | 3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      |                                                  ^~~~~~
a.cc:34:71: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   34 | 3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      |                                                                       ^~~~~~~
a.cc:42:50: warning: multi-character character constant [-Wmultichar]
   42 | 3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      |                                                  ^~~~~~
a.cc:42:71: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   42 | 3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      |                                                                       ^~~~~~~
a.cc:101:37: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
  101 | 3.cpp:24:32: error: no member named 'factorial' in namespace 'std'
      |                                     ^~~~~~~~~~~
a.cc:101:62: warning: multi-character character constant [-Wmultichar]
  101 | 3.cpp:24:32: error: no member named 'factorial' in namespace 'std'
      |                                                              ^~~~~
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Tue Nov 12 10:23:41 on ttys001
      | ^~~~
a.cc:34:58: error: 'did' does not name a type
   34 | 3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      |                                                          ^~~
a.cc:36:18: error: expected unqualified-id before '^' token
   36 |                  ^~~~
      |                  ^
a.cc:42:58: error: 'did' does not name a type
   42 | 3.cpp:18:18: error: use of undeclared identifier 'math'; did you mean 'catch'?
      |                                                          ^~~
a.cc:44:18: error: expected unqualified-id before '^' token
   44 |                  ^~~~
      |                  ^
a.cc:103:28: error: expected class-name before '~' token
  103 |                           ~~~~~^
      |                            ^
a.cc:177:10: error: expected unqualified-id before '^' token
  177 |          ^
      |          ^
a.cc:179:1: error: expected unqualified-id before numeric constant
  179 | 4.cpp:30:29: error: expected ';' after expression
      | ^~~~~
a.cc:183:1: error: expected unqualified-id before numeric constant
  183 | 2 errors generated.
      | ^
a.cc:196:29: error: expected unqualified-id before '^' token
  196 |                             ^
      |                             ^
a.cc:198:1: error: expected unqualified-id before numeric constant
  198 | 4.cpp:30:29: warning: expression result unused [-Wunused-value]
      | ^~~~~
a.cc:200:29: error: expected unqualified-id before '^' token
  200 |                             ^
      |                             ^
a.cc:297:2: error: expected unqualified-id before '/' token
  297 | */
      |  ^
a.cc:298:1: error: expected declaration before '}' token
  298 | }
      | ^
a.cc:300:1: error: expected declaration before '}' token
  300 | }
      | ^
a.cc:302:1: error: 'N' does not name a type
  302 | N = P_old[x];
      | ^
a.cc:304:1: error: expected unqualified-id before 'if'
  304 | if(N>1000000007){
      | ^~
a.cc:309:1: error: expected declaration before '}' token
  309 | }
      | ^
a.cc:313:6: error: 'cout' in namespace 'std' does not name a type
  313 | std::cout << N << std::endl;
      |      ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | Last login: Tue Nov 12 10:23:41 on ttys001
a.cc:316:1: error: expected unqualified-id before 'return'
  316 | return 0;
      | ^~~~~~
a.cc:317:1: error: expected declaration before '}' token
  317 | }
      | ^