Submission #80006

# Submission time Handle Problem Language Result Execution time Memory
80006 2018-10-18T07:12:01 Z pzdba Košnja (COCI17_kosnja) C++14
50 / 50
22 ms 868 KB
#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);
		n = min(n, m);
		if(n == 1) printf("1\n");
		else printf("%d\n", 2 + (n-2)*2);
	}
}

Compilation message

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 time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 372 KB Output is correct
3 Correct 2 ms 372 KB Output is correct
4 Correct 2 ms 408 KB Output is correct
5 Correct 2 ms 464 KB Output is correct
6 Correct 15 ms 612 KB Output is correct
7 Correct 22 ms 868 KB Output is correct
8 Correct 16 ms 868 KB Output is correct
9 Correct 22 ms 868 KB Output is correct
10 Correct 15 ms 868 KB Output is correct