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
#include
using namespace std; typedef long long ll; int main() { bool prva_nula = false; int tmp_min = 2e9, tmp_max = -2e9; int global_min = 2e9, global_max = -2e9; for(int i = 0; i < 1000000; i++) { int x; cin >> x; if(x == 11111) { break; } if(x == 0 and !prva_nula) { prva_nula = true; continue; } if(x !=0 and prva_nula) { tmp_min = min(tmp_min, x); tmp_max = max(tmp_max, x); } if(x == 0) { global_max = max(global_max, tmp_max); global_min = min(global_min, tmp_min); tmp_max = -2e9; tmp_min = 2e9; } } cout << global_max - global_min << endl; return 0; } // 2 1 3 3
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)