QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#178342 | #4295. Check Markers | NYCU_Yamada# | WA | 1ms | 3480kb | C++20 | 1.9kb | 2023-09-13 21:23:47 | 2023-09-13 21:23:47 |
Judging History
answer
#ifndef Yamada
#define Yamada
#include Yamada __FILE__ Yamada
void solve() {
int N; cin >> N;
vector<int> A(N), B(N);
for (int &x : A) cin >> x;
for (int &x : B) cin >> x;
int sumA = accumulate(ALL(A), int(0));
for (int i = 0; i < N; ++i) B[i] += A[i];
sort(RALL(B));
if (B[1] > sumA) cout << "NO" << "\n";
else cout << "YES" << "\n";
}
signed main() {
IOS();
int t = 1; cin >> t;
for (int i = 1; i <= t; ++i) solve();
return 0;
}
#else
#ifdef local
#define _GLIBCXX_DEBUG 1
#endif
#pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
// #define double __float80
using pii = pair<int, int>;
template <typename T> using MaxHeap = std::priority_queue<T>;
template <typename T> using MinHeap = std::priority_queue<T, vector<T>, greater<T>>;
// #define X first
// #define Y second
#define eb emplace_back
#define ef emplace_front
#define ee emplace
#define pb pop_back
#define pf pop_front
#define SZ(a) (int)((a).size())
#define ALL(a) begin(a), end(a)
#define RALL(a) rbegin(a), rend(a)
#ifdef local
#define IOS() void()
#define debug(...) \
fprintf(stderr, "%sAt [%s], line %d: (%s) = ", "\u001b[33m", __FUNCTION__, __LINE__, #__VA_ARGS__), \
_do(__VA_ARGS__), fprintf(stderr, "%s", "\u001b[0m")
template <typename T> void _do(T &&_t) {cerr << _t << "\n";}
template <typename T, typename ...U> void _do(T &&_t, U &&..._u) {cerr << _t << ", ", _do(_u...);}
#else
#define IOS() ios_base::sync_with_stdio(0); cin.tie(0)
#define debug(...) void()
#define endl '\n'
#endif
// mt19937_64 rng(steady::chrono_clock::now().time_since_epoch().count());
template <typename T, typename U> bool chmin(T &lhs, U rhs) {return lhs > rhs ? lhs = rhs, 1 : 0;}
template <typename T, typename U> bool chmax(T &lhs, U rhs) {return lhs < rhs ? lhs = rhs, 1 : 0;}
#endif
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3480kb
input:
3 3 1 2 1 2 1 1 2 1 1 2 2 4 1 1 1 1 2 1 2 1
output:
YES NO YES
result:
ok 3 token(s): yes count is 2, no count is 1
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3460kb
input:
100 4 1 4 1 5 4 1 4 1 4 3 3 2 5 1 2 3 1 4 0 1 1 4 3 1 3 5 4 1 0 1 5 5 5 5 3 4 0 4 4 0 4 3 1 0 4 2 3 5 4 0 3 4 4 4 5 5 4 0 4 1 2 0 4 5 2 0 2 4 5 1 1 4 5 0 3 3 1 1 3 1 4 2 4 5 5 4 5 3 1 4 0 3 0 2 1 3 5 3 4 4 2 2 1 0 2 5 3 4 4 0 2 2 4 2 5 3 4 4 2 4 3 1 4 1 5 4 2 3 3 3 5 3 0 4 4 3 4 1 0 4 0 4 2 4 4 1 0 ...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES NO YES YES YES YES ...
result:
wrong answer expected NO, found YES [3rd token]