QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#162206 | #7113. A+B Problem | SorahISA | AC ✓ | 1ms | 3572kb | C++20 | 6.7kb | 2023-09-03 06:41:02 | 2023-09-03 06:41:03 |
Judging History
answer
#ifndef SorahISA
#define SorahISA
#include SorahISA __FILE__ SorahISA
void solve() {
int A, B; cin >> A >> B;
cout << A + B << "\n";
}
int32_t main() {
fastIO();
int t = 1; // cin >> t;
for (int _ = 1; _ <= t; ++_) {
// cout << "Case #" << _ << ": ";
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 Prior = std::priority_queue<T>;
template <typename T> using prior = 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 ALL(x) begin(x), end(x)
#define RALL(x) rbegin(x), rend(x)
#define SZ(x) ((int)(x).size())
template <size_t D, typename T> struct Vec : vector<Vec<D-1, T>> {
static_assert(D >= 1, "Vector dimension must be greater than zero!");
template <typename... Args> Vec(int n = 0, Args... args) : vector<Vec<D-1, T>>(n, Vec<D-1, T>(args...)) {}
};
template <typename T> struct Vec<1, T> : vector<T> {
Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {}
};
template <class F>
inline constexpr decltype(auto) lambda_fix(F&& f) {
return [f = std::forward<F>(f)](auto&&... args) {
return f(f, std::forward<decltype(args)>(args)...);
};
}
#ifdef local
#define fastIO() void()
#define debug(...) \
_color.emplace_back("\u001b[31m"), \
fprintf(stderr, "%sAt [%s], line %d: (%s) = ", _color.back().c_str(), __FUNCTION__, __LINE__, #__VA_ARGS__), \
_do(__VA_ARGS__), _color.pop_back(), \
fprintf(stderr, "%s", _color.back().c_str())
deque<string> _color{"\u001b[0m"};
template <typename T> concept is_string = is_same_v<T, string&> or is_same_v<T, const string&>;
template <typename T> concept is_iterable = requires (T _t) {begin(_t);};
template <typename T> inline void _print_err(T &&_t);
template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>);
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(const tuple<U...> &);
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(const tuple<U...> &_t);
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &);
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(tuple<U...> &_t);
template <typename T, typename U> ostream& operator << (ostream &os, const pair<T, U> &_tu);
inline void _do() {cerr << "\n";};
template <typename T> inline void _do(T &&_t) {_print_err(_t), cerr << "\n";}
template <typename T, typename ...U> inline void _do(T &&_t, U &&..._u) {_print_err(_t), cerr << ", ", _do(_u...);}
#else
#define fastIO() ios_base::sync_with_stdio(0), cin.tie(0)
#define debug(...) void()
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int getRand(int L, int R) {
if (L > R) swap(L, R);
return (int)(rng() % ((uint64_t)R - L + 1) + L);
}
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;}
/// below are Fast I/O and _print_err templates ///
/*
/// Fast I/O by FHVirus ///
/// https://fhvirus.github.io/blog/2020/fhvirus-io/ ///
#include <unistd.h>
const int S = 65536;
int OP = 0;
char OB[S];
inline char RC() {
static char buf[S], *p = buf, *q = buf;
return p == q and (q = (p = buf) + read(0, buf, S)) == buf ? -1 : *p++;
}
inline int RI() {
static char c;
int a;
while (((c = RC()) < '0' or c > '9') and c != '-' and c != -1);
if (c == '-') {
a = 0;
while ((c = RC()) >= '0' and c <= '9') a *= 10, a -= c ^ '0';
}
else {
a = c ^ '0';
while ((c = RC()) >= '0' and c <= '9') a *= 10, a += c ^ '0';
}
return a;
}
inline void WI(int n, char c = '\n') {
static char buf[20], p;
if (n == 0) OB[OP++] = '0';
p = 0;
if (n < 0) {
OB[OP++] = '-';
while (n) buf[p++] = '0' - (n % 10), n /= 10;
}
else {
while (n) buf[p++] = '0' + (n % 10), n /= 10;
}
for (--p; p >= 0; --p) OB[OP++] = buf[p];
OB[OP++] = c;
if (OP > S-20) write(1, OB, OP), OP = 0;
}
/// Fast I/O by FHVirus ///
/// https://fhvirus.github.io/blog/2020/fhvirus-io/ ///
*/
#ifdef local
template <typename T> inline void _print_err(T &&_t) {cerr << _t;}
template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back() << "[";
for (bool _first = true; auto &_x : _t) {
if (!_first) cerr << ", ";
_print_err(_x), _first = false;
}
cerr << "]" << (_color.pop_back(), _color.back());
}
template <typename T, typename U> ostream& operator << (ostream &os, const pair<T, U> &_tu) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back() << "(";
_print_err(_tu.first), cerr << ", ", _print_err(_tu.second);
cerr << ")" << (_color.pop_back(), _color.back());
return os;
}
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(const tuple<U...> &) {
cerr << ")" << (_color.pop_back(), _color.back());
}
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(const tuple<U...> &_t) {
if (!I) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back();
}
cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &) {
cerr << ")" << (_color.pop_back(), _color.back());
}
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(tuple<U...> &_t) {
if (!I) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back();
}
cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}
#endif
#endif
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3564kb
input:
2669 -154
output:
2515
result:
ok 1 number(s): "2515"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
-851839419 34688642
output:
-817150777
result:
ok 1 number(s): "-817150777"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3404kb
input:
-496405053 -492673762
output:
-989078815
result:
ok 1 number(s): "-989078815"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3400kb
input:
153996608 390029247
output:
544025855
result:
ok 1 number(s): "544025855"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
509430974 -432300451
output:
77130523
result:
ok 1 number(s): "77130523"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
-840167367 450402558
output:
-389764809
result:
ok 1 number(s): "-389764809"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
-779700294 -76959846
output:
-856660140
result:
ok 1 number(s): "-856660140"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
-181176136 805743163
output:
624567027
result:
ok 1 number(s): "624567027"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
469225525 -311553829
output:
157671696
result:
ok 1 number(s): "157671696"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3400kb
input:
824659891 866116474
output:
1690776365
result:
ok 1 number(s): "1690776365"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
-181402541 -196228170
output:
-377630711
result:
ok 1 number(s): "-377630711"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
417121618 686474839
output:
1103596457
result:
ok 1 number(s): "1103596457"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
-932476723 -135854859
output:
-1068331582
result:
ok 1 number(s): "-1068331582"
Test #14:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
-577042357 -958184557
output:
-1535226914
result:
ok 1 number(s): "-1535226914"
Test #15:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
-516575284 219485746
output:
-297089538
result:
ok 1 number(s): "-297089538"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3436kb
input:
133826376 -897811246
output:
-763984870
result:
ok 1 number(s): "-763984870"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3376kb
input:
489260742 -15108237
output:
474152505
result:
ok 1 number(s): "474152505"
Test #18:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
-617247806 -542470641
output:
-1159718447
result:
ok 1 number(s): "-1159718447"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
-261813440 340232368
output:
78418928
result:
ok 1 number(s): "78418928"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
-201346367 -482097330
output:
-683443697
result:
ok 1 number(s): "-683443697"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
889700307 83152852
output:
972853159
result:
ok 1 number(s): "972853159"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
-754865328 965855862
output:
210990534
result:
ok 1 number(s): "210990534"
Test #23:
score: 0
Accepted
time: 1ms
memory: 3392kb
input:
-399430961 438493458
output:
39062497
result:
ok 1 number(s): "39062497"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
199093197 -678803534
output:
-479710337
result:
ok 1 number(s): "-479710337"
Test #25:
score: 0
Accepted
time: 1ms
memory: 3396kb
input:
849494857 498866769
output:
1348361626
result:
ok 1 number(s): "1348361626"
Test #26:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
-795070777 -618430223
output:
-1413501000
result:
ok 1 number(s): "-1413501000"
Test #27:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
-439636411 559240080
output:
119603669
result:
ok 1 number(s): "119603669"
Test #28:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
-84202044 -263089618
output:
-347291662
result:
ok 1 number(s): "-347291662"
Test #29:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
271232322 619613391
output:
890845713
result:
ok 1 number(s): "890845713"
Test #30:
score: 0
Accepted
time: 0ms
memory: 3432kb
input:
-835276227 -202716307
output:
-1037992534
result:
ok 1 number(s): "-1037992534"
Test #31:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
-334164140 119444083
output:
-214720057
result:
ok 1 number(s): "-214720057"