QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#783723#3573. Joint VentureSGColin#0 0ms3652kbC++17920b2024-11-26 11:31:492024-11-26 11:31:49

Judging History

This is the latest submission verdict.

  • [2024-11-26 11:31:49]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 3652kb
  • [2024-11-26 11:31:49]
  • Submitted

answer

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

typedef long long ll;
typedef pair<int, int> pii;

#define eb emplace_back
#define pb push_back
#define all(s) (s).begin(), (s).end()
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)

inline int rd() {
    int x = 0;
    bool f = 0;
    char c = getchar();
    for (; !isdigit(c); c = getchar()) f |= (c == '-');
    for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
    return f ? -x : x;
}

int main() {
    int L = rd() * 10'000'000;
    int n = rd();
    vector<int> num;
    set<int> s;
    rep(i, 1, n) {
        int x = rd();
        num.eb(x);
        s.insert(x);
    }
    sort(all(num));
    reverse(all(num));
    for (auto x : num) if (s.find(L - x) != s.end()) {
        printf("yes %d %d\n", L - x, x); return 0;
    }
    puts("danger");
    return 0;
}

详细


Pretests


Final Tests

Test #1:

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

input:

1
4
9999998
1
2
9999999
1
0
1
1
5
1
1
10000000
1
1
5000000
1
2
9999997
3
1
2
9999998
3
1
3
2
9999997
5000000
1
3
4
9999996
5000000
1
3
5000000
5000000
5000000
1
3
5000000
5000000
2345
1
3
5000000
3455
5000000
1
3
6000000
5000000
5000000
1
4
2000000
3000000
5000000
6000000
1
4
2000000
4000000
5000000...

output:

yes 1 9999999

result:

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