Submission #80005

#TimeUsernameProblemLanguageResultExecution timeMemory
80005pzdbaKošnja (COCI17_kosnja)C++14
0 / 50
26 ms724 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int k, n, m; scanf("%d", &k); for(int i=1;i<=k;i++){ scanf("%d%d", &n, &m); int n = min(n, m); if(n == 1) printf("1\n"); else printf("%d\n", 2 + (n-2)*2); } }

Compilation message (stderr)

kosnja.cpp: In function 'int main()':
kosnja.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &k);
  ~~~~~^~~~~~~~~~
kosnja.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &n, &m);
   ~~~~~^~~~~~~~~~~~~~~~
kosnja.cpp:9:7: warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int n = min(n, m);
       ^
#Verdict Execution timeMemoryGrader output
Fetching results...