Submission #80004

#TimeUsernameProblemLanguageResultExecution timeMemory
80004pzdbaKošnja (COCI17_kosnja)C++14
20 / 50
24 ms3272 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 mn = min(n, m); if(mn == 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);
   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...