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
using namespace std; int main() { int n, x, y, v; cin >> n >> x >> y >> v; int prv_tip[n][n]; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(i % 2 == 0) { if(j % 2 == 0) { prv_tip[i][j] = 0; } else { prv_tip[i][j] = 1; } } else { if(j % 2 == 0) { prv_tip[i][j] = 1; } else { prv_tip[i][j] = 0; } } } } int vtor_tip[n][n]; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(j < n - i) { vtor_tip[i][j] = 1; } else { vtor_tip[i][j] = 0; } } } if(v == prv_tip[y][x] and v == vtor_tip[y][x]) { cout << 3 << endl; } else if(v == prv_tip[y][x]) { cout << 1 << endl; } else if(v == vtor_tip[y][x]) { cout << 2 << endl; } else { cout << 4 << 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)