Submission #153161

#TimeUsernameProblemLanguageResultExecution timeMemory
153161tushar_2658medians (balkan11_medians)C++14
0 / 100
34 ms3448 KiB
#include "bits/stdc++.h" using namespace std; const int maxn = 2e5 + 5; int b[maxn], a[maxn]; int main(int argc, char const *argv[]) { // freopen("in.txt", "r", stdin); int n; scanf("%d", &n); int maxi = -1; for(int i = 1; i <= n; i++){ scanf("%d", &b[i]); if(b[i] > maxi)maxi = b[i]; } for(int i = 1; i <= n; i++){ a[2*i-1] = b[i]; } for(int i = 1; i <= 2*n-1; i++){ if(!a[i])a[i] = maxi + 1; } for(int i = 1; i <= 2*n-1; i++)printf("%d ", a[i]); return 0; }

Compilation message (stderr)

medians.cpp: In function 'int main(int, const char**)':
medians.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
medians.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &b[i]);
         ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...