strange_device.cpp: In function 'int main()':
strange_device.cpp:13:30: error: expected ';' before 'return'
13 | cout << x << endl
| ^
| ;
14 | return 0;
| ~~~~~~
strange_device.cpp:19:20: error: 'struct std::pair<long long int, long long int>' has no member named 'push_back'
19 | ranges.push_back({l,r});
| ^~~~~~~~~
strange_device.cpp:22:20: error: 'struct std::pair<long long int, long long int>' has no member named 'push_back'
22 | ranges.push_back({0,r});
| ^~~~~~~~~
strange_device.cpp:23:20: error: 'struct std::pair<long long int, long long int>' has no member named 'push_back'
23 | ranges.push_back({l,x-1});
| ^~~~~~~~~
strange_device.cpp:26:17: error: 'struct std::pair<long long int, long long int>' has no member named 'begin'
26 | sort(ranges.begin(),ranges.end());
| ^~~~~
strange_device.cpp:26:32: error: 'struct std::pair<long long int, long long int>' has no member named 'end'
26 | sort(ranges.begin(),ranges.end());
| ^~~
strange_device.cpp:27:30: error: no match for 'operator[]' (operand types are 'std::pair<long long int, long long int>' and 'int')
27 | long long int curl=ranges[0].first,curr=ranges[0].second,ans=0;
| ^
strange_device.cpp:28:26: error: 'struct std::pair<long long int, long long int>' has no member named 'size'
28 | for(int i=1;i<ranges.size();i++){
| ^~~~
strange_device.cpp:29:55: error: no match for 'operator[]' (operand types are 'std::pair<long long int, long long int>' and 'int')
29 | pair<long long int,long long int> range=ranges[i];
| ^
strange_device.cpp:30:12: error: 'curr' was not declared in this scope; did you mean 'curl'?
30 | if(curr<range.first){
| ^~~~
| curl
strange_device.cpp:31:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
31 | ans+=(curr-curl+1);
| ^~~
| abs
strange_device.cpp:39:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
39 | ans+=(curr-curl+1);
| ^~~
| abs
strange_device.cpp:39:11: error: 'curr' was not declared in this scope; did you mean 'curl'?
39 | ans+=(curr-curl+1);
| ^~~~
| curl