답안 #381328

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
381328 2021-03-25T06:16:55 Z AdiZer0 Košnja (COCI17_kosnja) C++17
50 / 50
19 ms 620 KB
#include <bits/stdc++.h>

#define pb push_back
#define whole(x) x.begin(), x.end()
#define sz(x) (int)x.size()

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = (int)3e5 + 7;
const int INF = (int)1e9 + 7;
const ll linf = (ll)1e18 + 1;

void solve() { 
    int n, m; scanf ("%d %d", &n, &m);
    if (n > m) swap(n, m);
    ll ans = (n - 1) * 1ll * 2;
    printf ("%lld\n", ans);
}

int main() {
    int tt; scanf ("%d", &tt);
    while (tt--) solve();
    return 0;
}

Compilation message

kosnja.cpp: In function 'void solve()':
kosnja.cpp:17:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   17 |     int n, m; scanf ("%d %d", &n, &m);
      |               ~~~~~~^~~~~~~~~~~~~~~~~
kosnja.cpp: In function 'int main()':
kosnja.cpp:24:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   24 |     int tt; scanf ("%d", &tt);
      |             ~~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 12 ms 492 KB Output is correct
7 Correct 18 ms 620 KB Output is correct
8 Correct 13 ms 492 KB Output is correct
9 Correct 19 ms 620 KB Output is correct
10 Correct 16 ms 492 KB Output is correct