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
number = int(input()) my_stack = [] for _ in range(number): query = input() query_split = query.split() command = query_split[0] if command == "1": current_number = int(query_split[1]) my_stack.append(current_number) elif command == "2" and my_stack: my_stack.pop() elif command == "3" and my_stack: print(max(my_stack)) elif command == "4" and my_stack: print(min(my_stack)) reversed_stack = [] while my_stack: reversed_stack.append(str(my_stack.pop())) print(", ".join(reversed_stack))
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)