paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:4:32: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
4 | #define f(ii,qwe) for(ll i=ii;i<qwe;i++)
| ~^~~~~~~~~
5 | #define f2(ii,qwe) for(ll j=ii;j<qwe;j++)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 | #define INF 2000000001
| ~~~~~~~~~~~~~~~~~~~~~~
7 | #define INFLL 3000000000000000001LL
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 |
|
9 | /*
| ~~
10 | 8
| ~
11 | 3
| ~
12 | 5
| ~
13 | 3 3 1 3 4 4 2 2
| ~~~~~~~~~~~~~~~
14 | 3 2 2
| ~~~~~
15 | 0 1 2
| ~~~~~
16 | 2 3
| ~~~
17 | 3 4
| ~~~
18 |
|
19 | 8
| ~
20 | 5
| ~
21 | 5
| ~
22 | 0 1 2 3 4 0 1 2
| ~~~~~~~~~~~~~~~
23 | 1 1 1 1 1
| ~~~~~~~~~
24 | 0 1 2 3 4
| ~~~~~~~~~
25 | */
| ~~
26 |
|
27 | int minimumInstructions(int n, int m, int k, vector<int>c, vector<int>a, vector<vector<int>>b){
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28 | map<int,int>mp;
| ~~~~~~~~~~~~~~~
29 | f(0,k){
| ~~~~~~~
30 | mp[i]=-1;
| ~~~~~~~~~
31 | }
| ~
32 | f(0,m){
| ~~~~~~~
33 | f2(0,a[i]){
| ~~~~~~~~~~~
34 | mp[b[i][j]]=i;
| ~~~~~~~~~~~~~~
35 | }
| ~
36 | }
| ~
37 | set<int>beg;
| ~~~~~~~~~~~~
38 | f(0,n){
| ~~~~~~~
39 | c[i]=mp[c[i]];
| ~~~~~~~~~~~~~~
40 | if(c[i]==-1){
| ~~~~~~~~~~~~~
41 | return -1;
| ~~~~~~~~~~
42 | }
| ~
43 | }
| ~
44 | f(0,n){
| ~~~~~~~
45 | if(c[i]==0){
| ~~~~~~~~~~~~
46 | beg.insert(i);
| ~~~~~~~~~~~~~~
47 | }
| ~
48 | }
| ~
49 | vector<pair<int,int>>vec;
| ~~~~~~~~~~~~~~~~~~~~~~~~~
50 | for(int i:beg){
| ~~~~~~~~~~~~~~~
51 | int cur=i+1;
| ~~~~~~~~~~~~
52 | bool b=1;
| ~~~~~~~~~
53 | int mx=i+m;
| ~~~~~~~~~~~
54 | bool b2=1;
| ~~~~~~~~~~
55 | f2(1,m){
| ~~~~~~~~
56 | if(cur<n&&c[cur]==j);
| ~~~~~~~~~~~~~~~~~~~~~
57 | else if(b&&cur-m>=0&&c[cur-m]==j){
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 | b=0;
| ~~~~
59 | mx=cur;
| ~~~~~~~
60 | cur-=m;
| ~~~~~~~
61 | }
| ~
62 | else{
| ~~~~~
63 | b2=0;
| ~~~~~
64 | break;
| ~~~~~~
65 | }
| ~
66 | cur++;
| ~~~~~~
67 | }
| ~
68 | if(b2){
| ~~~~~~~
69 | vec.push_back({mx-m,mx});
| ~~~~~~~~~~~~~~~~~~~~~~~~~
70 | }
| ~
71 | }
| ~
72 | int cur=0;
| ~~~~~~~~~~
73 | int ret=0;
| ~~~~~~~~~~
74 | f(0,vec.size()){
| ~~~~~~~~~~~~~~
paint.cpp:74:5: note: in expansion of macro 'f'
74 | f(0,vec.size()){
| ^
paint.cpp:75:13: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
75 | if(i<vec.size()-1&&vec[i+1].first<=cur)continue;
| ~^~~~~~~~~~~~~