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, m; cin >> n >> m; int mat[n][m]; for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { cin >> mat[i][j]; } } int x1, y1; cin >> x1 >> y1; int x2, y2; cin >> x2 >> y2; int zbir1 = 0; if(x1 - 1 >= 0) { // postoi gorniot sosed zbir1 += mat[x1 - 1][y1]; } if(x1 + 1 < n) { // postoi dolniot sosed zbir1 += mat[x1 + 1][y1]; } if(y1 - 1 >= 0) { // postoi leviot sosed zbir1 += mat[x1][y1 - 1]; } if(y1 + 1 < m) { // postoi desniot sosed zbir1 += mat[x1][y1 + 1]; } int zbir2 = 0; if(x2 - 1 >= 0) { // postoi gorniot sosed zbir2 += mat[x2 - 1][y2]; } if(x2 + 1 < n) { // postoi dolniot sosed zbir2 += mat[x2 + 1][y2]; } if(y2 - 1 >= 0) { // postoi leviot sosed zbir2 += mat[x2][y2 - 1]; } if(y2 + 1 < m) { zbir2 += mat[x2][y2 + 1]; } if(zbir1 > zbir2) { cout << "Poleto so indeks: (" << x1 << "," << y1 << ") ima pogolem zbir na sosedi" << endl; } else { cout << "Poleto so indeks: (" << x2 << "," << y2 << ") ima pogolem zbir na sosedi" << 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)