Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
B prethodnih B sledecih
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
program BprethodnihBsledecih; var a:array[1..50] of integer; b,i,n,j,sum1:integer; begin read(n); for i:=1 to n do read(a[i]); read(b); for i:=1 to n do begin j:=1;sum1:=0; while(j<=b) and ((i-j)>0) do begin sum1:=sum1+a[i-j]; j:=j+1 end; if(((j-1)*a[i])>sum1) then begin j:=1; sum1:=0; while(j<=b) and ((i+j)<=n) do begin sum1:=sum1+a[i+j]; j:=j+1 end; if(((j-1)*a[i])>sum1) then writeln(i) end end end.
20 1 2 3 5 5 8 9 4 6 1 12 13 7 6 4 15 8 8 4 1 2
Show compiler warnings
[
-
]
Show input
Compilation time: 0.31 sec, absolute running time: 0.09 sec, cpu time: 0.03 sec, memory peak: 3 Mb, absolute service time: 0,48 sec
edit mode
|
history
|
discussion