Submission #171328

#TimeUsernameProblemLanguageResultExecution timeMemory
171328itiamPismo (COCI18_pismo)C++11
70 / 70
72 ms1280 KiB
#include <iostream> using namespace std; int main(){ int N,njm,prix,x,v,m,raz; cin >> N; cin >> prix; for (int i=0;i<N-1;i++){ cin >> x; if (x>prix){ raz=x-prix;} else{ raz=prix-x;} if (i==0){ njm=raz; } else{ if (njm>raz) njm=raz; } prix=x; } cout << njm; return 0; }

Compilation message (stderr)

pismo.cpp: In function 'int main()':
pismo.cpp:6:22: warning: unused variable 'v' [-Wunused-variable]
     int N,njm,prix,x,v,m,raz;
                      ^
pismo.cpp:6:24: warning: unused variable 'm' [-Wunused-variable]
     int N,njm,prix,x,v,m,raz;
                        ^
pismo.cpp:23:10: warning: 'njm' may be used uninitialized in this function [-Wmaybe-uninitialized]
     cout << njm;
     ~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...