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
using namespace std; int main() { int global_max = 0, global_min = 6001; int tmp_max = 0, tmp_min = 6001; int x; int nuli = 0; while(cin >> x) { if(x == 11111) { break; } if(x == 0 and nuli == 0) { nuli = 1; continue; } if(x != 0 and nuli > 0) { tmp_max = max(tmp_max, x); tmp_min = min(tmp_min, x); } if(x == 0) { global_max = max(global_max, tmp_max); global_min = min(global_min, tmp_min); tmp_max = 0; tmp_min = 6001; } } cout << global_max - global_min << endl; return 0; } // 650 1500 0 600 1000 2000 0 800 1500 0 1500 1300 1400 11111 /* tmp_min = 800 tmp_max = 1500 global_min = 600 global_max = 2000 */
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)