QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#593730#7638. LakewkrWA 0ms3648kbC++20635b2024-09-27 15:42:452024-09-27 15:42:46

Judging History

你现在查看的是最新测评结果

  • [2024-09-27 15:42:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-09-27 15:42:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long int

signed main() {
    int n, m;
    cin >> n >> m;
    int ans = 0;
    while (n > 0 || m > 0) {
        if (n >= 3 && m >= 3) {
            n -= 3;
            m -= 3;
            if (n > m) {
                --n;
            } else {
                --m;
            }
        } else if (n >= 3) {
            m = 0;
            n -= 4;
        } else if (m >= 3) {
            m -= 4;
            n = 0;
        } else {
            m = 0;
            n = 0;
        }
        ++ans;
    }
    cout << ans << endl;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3648kb

input:

1 1

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1 4

output:

1

result:

ok single line: '1'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3644kb

input:

5 5

output:

2

result:

wrong answer 1st lines differ - expected: '3', found: '2'