# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
37974 | 2017-12-29T19:18:38 Z | wasyl | Košnja (COCI17_kosnja) | C++11 | 136 ms | 2016 KB |
#include <cstdio> #include <vector> #include <iostream> #include <algorithm> #define d(...) __VA_ARGS__ #define all(x) (x).begin(), (x).end() #define eb(...) emplace_back(__VA_ARGS__) using namespace std;using ll=long long; template<class t>using V = vector< t >; int main() { int n; scanf( "%d", &n ); while ( n-- ) { int a, b; cin >> a >> b; int c = min( a, b ); int res = ( c / 2 ) * 4; res -= ( c % 2 == 0 ? 2 : 0 ); printf( "%d\n", res ); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2016 KB | Output is correct |
2 | Correct | 0 ms | 2016 KB | Output is correct |
3 | Correct | 0 ms | 2016 KB | Output is correct |
4 | Correct | 0 ms | 2016 KB | Output is correct |
5 | Correct | 0 ms | 2016 KB | Output is correct |
6 | Correct | 56 ms | 2016 KB | Output is correct |
7 | Correct | 136 ms | 2016 KB | Output is correct |
8 | Correct | 53 ms | 2016 KB | Output is correct |
9 | Correct | 83 ms | 2016 KB | Output is correct |
10 | Correct | 86 ms | 2016 KB | Output is correct |