QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#401650#7102. Live Lovemiaokx#WA 0ms3644kbC++20757b2024-04-29 07:02:272024-04-29 07:02:27

Judging History

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

  • [2024-04-29 07:02:27]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3644kb
  • [2024-04-29 07:02:27]
  • 提交

answer

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void solve() {
    int n, m;
    cin >> n >> m;
    cout << m << ' ';
    if (!m) {
        cout << m << '\n';
        return;
    }
    // if (n-m >= m-1) {
        // cout << 1 << '\n';
    // } else {
        int l = n-m;
        int res = m - m / (l+1) * l;
        assert(res >= m/(l+1));
        cout << res << '\n';
    // }
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}

詳細信息

Test #1:

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

input:

5
5 4
100 50
252 52
3 0
10 10

output:

4 2
50 50
52 52
0 0
10 10

result:

wrong answer 2nd lines differ - expected: '50 1', found: '50 50'