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 n, k; cin >> n >> k; n = 2 * (n - 1); int wins = 2e9, losses = 2e9, draws = 2e9; for(int x = 0; x <= n; x++) { for(int y = 0; y <= n; y++) { if(x + y <= n) { int z = n - x - y; if(3 * x + y == k) { if(z < losses) { wins = x; losses = z; draws = y; } } } } } cout << wins << " " << draws << " " << losses << endl; return 0; }
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)