Language: C++

ISDL-Public-iMac:study mekidosdkl$ cd atb
ISDL-Public-iMac:atb mekidosdkl$ cd abc142
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o a a.cpp
a.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
1 warning generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
4
0.500000000000
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
5
0.600000000000
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
6
0.500000000000
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
1
1.000000000000
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
2
0.500000000000
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
19
0.526315789474
ISDL-Public-iMac:abc142 mekidosdkl$ ./a
18
0.500000000000
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o b b.cpp
b.cpp:12:15: warning: variable 'K' is uninitialized when used here [-Wuninitialized]
        if(h>=K) ans++;
              ^
b.cpp:8:12: note: initialize the variable 'K' to silence this warning
    int N,K,ans=0,h;
           ^
            = 0
b.cpp:9:19: warning: variable 'N' is uninitialized when used here [-Wuninitialized]
    for(int i=0;i<N;i++)
                  ^
b.cpp:8:10: note: initialize the variable 'N' to silence this warning
    int N,K,ans=0,h;
         ^
          = 0
b.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./b
^C
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o b b.cpp
b.cpp:13:15: warning: variable 'K' is uninitialized when used here [-Wuninitialized]
        if(h>=K) ans++;
              ^
b.cpp:8:12: note: initialize the variable 'K' to silence this warning
    int N,K,ans=0,h;
           ^
            = 0
b.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
2 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./b
^C
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o b b.cpp
b.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
1 warning generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./b
4 150
150 140 100 200
2
ISDL-Public-iMac:abc142 mekidosdkl$ ./b
1 500
499
0
ISDL-Public-iMac:abc142 mekidosdkl$ ./b
5 1
100 200 300 400 500
5
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o c c.cpp
c.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
1 warning generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./c
3
2 3 1
2 3 1
ISDL-Public-iMac:abc142 mekidosdkl$ ./c
^C
ISDL-Public-iMac:abc142 mekidosdkl$ ./b
^C
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o c c.cpp
c.cpp:8:21: warning: unused variable 'ans' [-Wunused-variable]
    int N,A[100005],ans[100005];
                    ^
c.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
2 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o c c.cpp
c.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
1 warning generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./c
3
2 3 1
3 1 2
ISDL-Public-iMac:abc142 mekidosdkl$ ./c
5
1 2 3 4 5
1 2 3 4 5
ISDL-Public-iMac:abc142 mekidosdkl$ ./c
8
8 2 7 3 4 5 6 1
8 2 4 5 6 7 3 1
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
2 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
100000000000 9999999999
0
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
100000000000 100000000 
80
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
100000000000 10000000000
120
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1000000000000 1000000000000
168
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1000 1000
15
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
9999 9999
11
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
99999999 99999999
47
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
2 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1000000000 1000000000
2
4
5
8
10
16
20
25
32
40
50
64
80
100
125
128
160
200
250
256
320
400
500
512
625
640
800
1000
1250
1280
1600
2000
2500
2560
3125
3200
4000
5000
6250
6400
8000
10000
12500
12800
15625
16000
20000
25000
31250
32000
40000
50000
62500
64000
78125
80000
100000
125000
156250
160000
200000
250000
312500
320000
390625
400000
500000
625000
781250
800000
1000000
1250000
1562500
1600000
1953125
2000000
2500000
3125000
3906250
4000000
5000000
6250000
7812500
8000000
10000000
12500000
15625000
20000000
25000000
31250000
40000000
50000000
62500000
100000000
125000000
200000000
250000000
500000000
1000000000
99
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:88:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto it=NG.find(div[i]);
        ^
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
12 18
3
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
420 660
9
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1 2019
1
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto it=NG.find(div[i]);
        ^
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
420 660
2
3
4
5
6
10
12
15
20
9
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto it=NG.find(div[i]);
        ^
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
420 660
2
3
4
5
6
10
12
15
20
9
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto it=NG.find(div[i]);
        ^
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
420 660
2
3
4
5
6
10
12
15
20
30
60
11
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
12 18
2
3
6
3
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto it=NG.find(div[i]);
        ^
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
12 18
2
3
6
2
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
420 660
2
3
4
5
6
10
12
15
20
30
60
3
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1
2019
0
ISDL-Public-iMac:abc142 mekidosdkl$ g++ -Wall -o d d.cpp
d.cpp:88:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto it=NG.find(div[i]);
        ^
d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
const int inf=1e9;
          ^
d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD=1e9+7;
          ^
3 warnings generated.
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1 2019
1
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
420 660
4
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
12 18
3
ISDL-Public-iMac:abc142 mekidosdkl$ ./d
1000000000000 1000000000000
3
ISDL-Public-iMac:abc142 mekidosdkl$ 

Compiler output:
a.cc:4:38: warning: multi-character character constant [-Wmultichar]
    4 | a.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:44:38: warning: multi-character character constant [-Wmultichar]
   44 | b.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:58:38: warning: multi-character character constant [-Wmultichar]
   58 | b.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:65:38: warning: multi-character character constant [-Wmultichar]
   65 | b.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:82:38: warning: multi-character character constant [-Wmultichar]
   82 | c.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:95:38: warning: multi-character character constant [-Wmultichar]
   95 | c.cpp:8:21: warning: unused variable 'ans' [-Wunused-variable]
      |                                      ^~~~~
a.cc:98:38: warning: multi-character character constant [-Wmultichar]
   98 | c.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:103:38: warning: multi-character character constant [-Wmultichar]
  103 | c.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:120:38: warning: multi-character character constant [-Wmultichar]
  120 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:123:38: warning: multi-character character constant [-Wmultichar]
  123 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:149:38: warning: multi-character character constant [-Wmultichar]
  149 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:152:38: warning: multi-character character constant [-Wmultichar]
  152 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:259:22: warning: multi-character character constant [-Wmultichar]
  259 | d.cpp:88:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      |                      ^~~~~~
a.cc:262:38: warning: multi-character character constant [-Wmultichar]
  262 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:265:38: warning: multi-character character constant [-Wmultichar]
  265 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:279:22: warning: multi-character character constant [-Wmultichar]
  279 | d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      |                      ^~~~~~
a.cc:282:38: warning: multi-character character constant [-Wmultichar]
  282 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:285:38: warning: multi-character character constant [-Wmultichar]
  285 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:302:22: warning: multi-character character constant [-Wmultichar]
  302 | d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      |                      ^~~~~~
a.cc:305:38: warning: multi-character character constant [-Wmultichar]
  305 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:308:38: warning: multi-character character constant [-Wmultichar]
  308 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:325:22: warning: multi-character character constant [-Wmultichar]
  325 | d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      |                      ^~~~~~
a.cc:328:38: warning: multi-character character constant [-Wmultichar]
  328 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:331:38: warning: multi-character character constant [-Wmultichar]
  331 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:356:22: warning: multi-character character constant [-Wmultichar]
  356 | d.cpp:92:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      |                      ^~~~~~
a.cc:359:38: warning: multi-character character constant [-Wmultichar]
  359 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:362:38: warning: multi-character character constant [-Wmultichar]
  362 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:391:22: warning: multi-character character constant [-Wmultichar]
  391 | d.cpp:88:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      |                      ^~~~~~
a.cc:394:38: warning: multi-character character constant [-Wmultichar]
  394 | d.cpp:5:11: warning: unused variable 'inf' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:397:38: warning: multi-character character constant [-Wmultichar]
  397 | d.cpp:6:11: warning: unused variable 'MOD' [-Wunused-const-variable]
      |                                      ^~~~~
a.cc:1:1: error: 'ISDL' does not name a type
    1 | ISDL-Public-iMac:study mekidosdkl$ cd atb
      | ^~~~
a.cc:6:11: error: expected unqualified-id before '^' token
    6 |           ^
      |           ^
a.cc:32:15: error: expected unqualified-id before '^' token
   32 |               ^
      |               ^
a.cc:35:12: error: expected unqualified-id before '^' token
   35 |            ^
      |            ^
a.cc:38:17: error: 'i' does not name a type
   38 |     for(int i=0;i<N;i++)
      |                 ^
a.cc:38:21: error: 'i' does not name a type
   38 |     for(int i=0;i<N;i++)
      |                     ^
a.cc:42:10: error: expected unqualified-id before '^' token
   42 |          ^
      |          ^
a.cc:46:11: error: expected unqualified-id before '^' token
   46 |           ^
      |           ^
a.cc:53:15: error: expected unqualified-id before '^' token
   53 |               ^
      |               ^
a.cc:56:12: error: expected unqualified-id before '^' token
   56 |            ^
      |            ^
a.cc:60:11: error: expected unqualified-id before '^' token
   60 |           ^
      |           ^
a.cc:67:11: error: expected unqualified-id before '^' token
   67 |           ^
      |           ^
a.cc:84:11: error: expected unqualified-id before '^' token
   84 |           ^
      |           ^
a.cc:97:21: error: expected unqualified-id before '^' token
   97 |                     ^
      |                     ^
a.cc:100:11: error: expected unqualified-id before '^' token
  100 |           ^
      |           ^
a.cc:105:11: error: expected unqualified-id before '^' token
  105 |           ^
      |           ^
a.cc:122:11: error: expected unqualified-id before '^' token
  122 |           ^
      |           ^
a.cc:125:11: error: expected unqualified-id before '^' token
  125 |           ^
      |           ^
a.cc:151:11: error: expected unqualified-id before '^' token
  151 |           ^
      |           ^
a.cc:154:11: error: expected unqualified-id before '^' token
  154 |           ^
      |           ^
a.cc:261:9: error: expected unqualified-id before '^' token
  261 |         ^
      |         ^
a.cc:264:11: error: expected unqualified-id before '^' token
  264 |           ^
      |           ^
a.cc:267:11: error: expected unqualified-id before '^' token
  267 |           ^
      |           ^
a.cc:281:9: error: expected unqualified-id before '^' token
  281 |         ^
      |         ^
a.cc:284:11: error: expected unqualified-id before '^' token
  284 |           ^
      |           ^
a.cc:287:11: error: expected unqualified-id before '^' token
  287 |           ^
      |           ^
a.cc:304:9: error: expected unqualified-id before '^' token
  304 |         ^
      |         ^
a.cc:307:11: error: expected unqualified-id before '^' token
  307 |           ^
      |           ^
a.cc:310:11: error: expected unqualified-id before '^' token
  310 |           ^
      |           ^
a.cc:327:9: error: expected unqualified-id before '^' token
  327 |         ^
      |         ^
a.cc:330:11: error: expected unqualified-id before '^' token
  330 |           ^
      |           ^
a.cc:333:11: error: expected unqualified-id before '^' token
  333 |           ^
      |           ^
a.cc:358:9: error: expected unqualified-id before '^' token
  358 |         ^
      |         ^
a.cc:361:11: error: expected unqualified-id before '^' token
  361 |           ^
      |           ^
a.cc:364:11: error: expected unqualified-id before '^' token
  364 |           ^
      |           ^
a.cc:393:9: error: expected unqualified-id before '^' token
  393 |         ^
      |         ^
a.cc:396:11: error: expected unqualified-id before '^' token
  396 |           ^
      |           ^
a.cc:399:11: error: expected unqualified-id before '^' token
  399 |           ^
      |           ^