답안 #80005

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
80005 2018-10-18T07:11:24 Z pzdba Košnja (COCI17_kosnja) C++14
0 / 50
26 ms 724 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);
		int 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);
   ~~~~~^~~~~~~~~~~~~~~~
kosnja.cpp:9:7: warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int n = min(n, m);
       ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 484 KB Output isn't correct
3 Incorrect 2 ms 484 KB Output isn't correct
4 Incorrect 2 ms 484 KB Output isn't correct
5 Incorrect 2 ms 484 KB Output isn't correct
6 Incorrect 14 ms 520 KB Output isn't correct
7 Incorrect 21 ms 692 KB Output isn't correct
8 Incorrect 16 ms 692 KB Output isn't correct
9 Incorrect 26 ms 724 KB Output isn't correct
10 Incorrect 18 ms 724 KB Output isn't correct