Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
//#include
#include
using namespace std; int rastojanie(int a, int b) { return abs(a-b); } string levo_ili_desno(pair
platforma, pair
otsecka) { if(otsecka.first
otsecka, pair
platforma) { if(otsecka.first
platforma.second) { return false; } if(otsecka.first>=platforma.first and otsecka.second<=platforma.second) { return true; } if(levo_ili_desno(platforma,otsecka)=="levo") { if(rastojanie(platforma.first,otsecka.second)>=rastojanie(platforma.first,otsecka.first)) { return true; } } else { if(rastojanie(otsecka.first,platforma.second)>=rastojanie(otsecka.second,platforma.second)) { return true; } } return false; } int main(){ int N,L; pair
platforma; cin>>N>>L; vector
> otsecka; platforma.first = 0; platforma.second = L; for(int i = 0; i
>x>>y; otsecka.push_back(make_pair(x,y)); } int brojac = 0; for(int i = 0; i
-5000 and dali_moze(otsecka[j], platforma)) { brojac++; platforma.first = min(platforma.first, otsecka[j].first); platforma.second = max(platforma.second, otsecka[j].second); otsecka[j].first = -5000; } } } cout<
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)