QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#456848 | #1. I/O Test | Floze3 | 200 ✓ | 183ms | 3852kb | C++14 | 19.8kb | 2024-06-28 15:35:40 | 2024-06-28 15:35:40 |
Judging History
config.txt
10000000 10000000
input_test
#include <bits/stdc++.h>
#define _FOR(i, a, b) for (int(i) = (a); (i) <= (b); ++(i))
#define _FRO(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define _ROF(i, a, b) for (int(i) = (a); (i) >= (b); --(i))
#define mp std::make_pair
#define eb emplace_back
#define pb pop_back
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define _FFF(i, u, e) for (int(i) = head[(u)]; (i); (i) = (e)[(i)].nxt)
#define file(name) \
freopen(name ".in", "r", stdin); \
freopen(name ".out", "w", stdout);
#define fs(x) std::fixed << std::setprecision(x)
#define il inline
#define Avada_Kedavra return 0
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
typedef __int128 i128;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;
typedef std::vector<int> vi;
typedef std::vector<ll> vll;
typedef std::vector<pii> vpii;
typedef std::vector<pll> vpll;
typedef std::stack<int> si;
typedef std::stack<ll> sll;
typedef std::stack<pii> spii;
typedef std::stack<pll> spll;
typedef std::queue<int> qi;
typedef std::queue<ll> qll;
typedef std::queue<pii> qpii;
typedef std::queue<pll> qpll;
typedef std::deque<int> dqi;
typedef std::deque<ll> dqll;
typedef std::deque<pii> dqpii;
typedef std::deque<pll> dqpll;
typedef std::priority_queue<int> pqi;
typedef std::priority_queue<ll> pqll;
typedef std::priority_queue<pii> pqpii;
typedef std::priority_queue<pll> pqpll;
typedef std::set<int> siset;
typedef std::set<ll> sllset;
typedef std::set<pii> spiiset;
typedef std::set<pll> spllset;
typedef std::multiset<int> simset;
typedef std::multiset<ll> sllmset;
typedef std::multiset<pii> spiimset;
typedef std::multiset<pll> spllmset;
typedef std::map<int, int> simap;
typedef std::map<ll, ll> sllmap;
typedef std::map<pii, pii> spiimap;
typedef std::map<pll, pll> spllmap;
typedef std::unordered_set<int> siuset;
typedef std::unordered_set<ll> slluset;
typedef std::unordered_set<pii> spiiuset;
typedef std::unordered_set<pll> splluset;
typedef std::unordered_map<int, int> siumap;
typedef std::unordered_map<ll, ll> sllumap;
typedef std::unordered_map<pii, pii> spiiumap;
typedef std::unordered_map<pll, pll> spllumap;
#define _IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr), std::cout.tie(nullptr)
namespace FastIO {
class FastIOBase {
protected:
#ifdef ONLINE_JUDGE
static const int BUFSIZE = 1 << 16;
char buf[BUFSIZE + 1];
int buf_p = 0;
#endif
FILE *target;
FastIOBase(FILE *f) : target(f) {}
~FastIOBase() = default;
public:
#ifdef ONLINE_JUDGE
virtual void flush() = 0;
#endif
};
class FastOutput final : public FastIOBase {
private:
void __putc(char x) {
#ifdef ONLINE_JUDGE
if (buf[buf_p++] = x, buf_p == BUFSIZE) flush();
#else
putc(x, target);
#endif
}
template <typename T> void __write(T x) {
char stk[std::numeric_limits<T>::digits10 + 1], *top = stk;
if (x < 0) return __putc('-'), __write(-x);
do *(top++) = x % 10, x /= 10;
while (x);
for (; top != stk; __putc(*(--top) + '0'));
}
public:
FastOutput(FILE *f = stdout) : FastIOBase(f) {}
#ifdef ONLINE_JUDGE
~FastOutput() { flush(); }
void flush() { fwrite(buf, 1, buf_p, target), buf_p = 0; }
#endif
FastOutput &operator<< (char x) { return __putc(x), *this; }
FastOutput &operator<< (const char *s) {
for (; *s; __putc(*(s++)));
return *this;
}
FastOutput &operator<< (const std::string &s) {
return (*this) << s.c_str();
}
template <typename T>
std::enable_if_t<std::is_integral<T>::value, FastOutput &> operator<< (const T &x) {
return __write(x), *this;
}
template <typename... T> void writesp(const T &...x) {
std::initializer_list<int>{(this->operator<< (x), __putc(' '), 0)...};
}
template <typename... T> void writeln(const T &...x) {
std::initializer_list<int>{(this->operator<< (x), __putc('\n'), 0)...};
}
template <typename Iter> void writesp(Iter begin, Iter end) {
while (begin != end) (*this) << *(begin++) << ' ';
}
template <typename Iter> void writeln(Iter begin, Iter end) {
while (begin != end) (*this) << *(begin++) << '\n';
}
} qout;
class FastInput final : public FastIOBase {
private:
bool __eof;
public:
FastInput(FILE *f = stdin)
: FastIOBase(f),
__eof(false)
#ifdef ONLINE_JUDGE
{
buf_p = BUFSIZE;
}
void flush() { buf[fread(buf, 1, BUFSIZE, target)] = EOF, buf_p = 0; }
bool eof() const { return buf[buf_p] == EOF; }
#else
{
}
bool eof() const { return feof(target); }
#endif
char get() {
if (__eof) return EOF;
#ifdef ONLINE_JUDGE
if (buf_p == BUFSIZE) flush();
char ch = buf[buf_p++];
#else
char ch = getc(target);
#endif
return ~ch ? ch : (__eof = true, EOF);
}
void unget(char c) {
__eof = false;
#ifdef ONLINE_JUDGE
buf[--buf_p] = c;
#else
ungetc(c, target);
#endif
}
explicit operator bool () const { return !__eof; }
FastInput &operator>> (char &x) {
while (isspace(x = get()));
return *this;
}
template <typename T>
std::enable_if_t<std::is_integral<T>::value, FastInput &> operator>> (T &x) {
char ch, sym = 0;
x = 0;
while (isspace(ch = get()));
if (__eof) return *this;
if (ch == '-') sym = 1, ch = get();
for (; isdigit(ch); x = (x << 1) + (x << 3) + (ch ^ 48), ch = get());
return unget(ch), sym ? x = -x : x, *this;
}
FastInput &operator>> (char *s) {
while (isspace(*s = get()));
if (__eof) return *this;
for (; !isspace(*s) && !__eof; *(++s) = get());
return unget(*s), *s = '\0', *this;
}
FastInput &operator>> (std::string &s) {
char str_buf[(1 << 8) + 1] = {0}, *p = str_buf;
char *const buf_end = str_buf + (1 << 8);
while (isspace(*p = get()));
if (__eof) return *this;
for (s.clear(), p++;; p = str_buf) {
for (; p != buf_end && !isspace(*p = get()) && !__eof; p++);
if (p != buf_end) break;
s.append(str_buf);
}
unget(*p), *p = '\0', s.append(str_buf);
return *this;
}
template <typename... T> void read(T &...x) {
std::initializer_list<int>{(this->operator>> (x), 0)...};
}
template <typename Iter> void read(Iter begin, Iter end) {
while (begin != end) (*this) >> *(begin++);
}
} qin;
} // namespace FastIO
#define read FastIO::qin
#define write FastIO::qout
namespace DEBUG {
#ifndef ONLINE_JUDGE
#define debug(a) std::cerr << "In Line" << __LINE__ << " the " << #a << " = " << a << '\n'
#define look_time std::cerr << clock() * 1e3 / CLOCKS_PER_SEC << " ms\n"
#define look_memory std::cerr << fabs(&med - &mst) / 1024.0 / 1024.0 << " mb\n"
#else
#define debug(...) ((void)0)
#define look_time ((void)0)
#define look_memory ((void)0)
#endif
} // namespace DEBUG
using namespace DEBUG;
namespace basic_algorithm {
template <typename T> il void swap(T &a, T &b) {
T t = a;
a = b, b = t;
}
template <typename T> il T lowbit(T x) { return (x & (-x)); }
template <typename T> il T max(T a, T b) { return a < b ? b : a; }
template <typename T> il T min(T a, T b) { return a > b ? b : a; }
template <typename T, typename... Args> il T max(T a, Args... args) {
return max(a, max(args...));
}
template <typename T, typename... Args> il T min(T a, Args... args) {
return min(a, min(args...));
}
template <typename T> il T abs(T a) { return a >= 0 ? a : -a; }
template <typename T> il T gcd(T a, T b) {
while (b) a %= b, swap(a, b);
return a;
}
template <typename T> il T lcm(T a, T b) { return a / gcd(a, b) * b; }
} // namespace basic_algorithm
using namespace basic_algorithm;
template <ll mod> struct Mint {
ll val;
il Mint(ll v = 0ll) : val((v % mod + mod) % mod) {}
il Mint operator-() const { return Mint(-val); }
il Mint operator+=(const Mint &b) {
if ((val += b.val) >= mod) val -= mod;
return *this;
}
il Mint &operator++() {
val++;
if (val == mod) val = 0;
return *this;
}
il Mint &operator--() {
if (val == 0) val = mod;
val--;
return *this;
}
il Mint operator++(int) {
Mint res = *this;
++*this;
return res;
}
il Mint operator--(int) {
Mint res = *this;
--*this;
return res;
}
il Mint operator-=(const Mint &b) {
if ((val -= b.val) < 0) val += mod;
return *this;
}
il Mint operator*=(const Mint &b) {
val = (val * b.val) % mod;
return *this;
}
il Mint operator/=(const Mint &b) {
return *this *= b.inv();
}
il Mint operator+(const Mint &b) const { return Mint(*this) += b; }
il Mint operator-(const Mint &b) const { return Mint(*this) -= b; }
il Mint operator*(const Mint &b) const { return Mint(*this) *= b; }
il Mint operator/(const Mint &b) const { return Mint(*this) /= b; }
il bool operator==(const Mint &b) const { return val == b.val; }
il bool operator!=(const Mint &b) const { return val != b.val; }
il Mint pow(ll n) const {
assert(n >= 0);
Mint res = 1, w = *this;
for (; n; n >>= 1, w *= w)
if (n & 1) res *= w;
return res;
}
il Mint inv() const { return pow(mod - 2); }
template <typename OUT> il friend OUT &operator<<(OUT &os, const Mint &x) {
return os << x.val;
}
template <typename IN> il friend IN &operator>>(IN &is, Mint &x) {
ll v;
is >> v;
x = Mint(v);
return is;
}
};
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const double pi = acos(-1.0);
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
const ll inf = 1e18;
typedef Mint<mod> mint;
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
bool mst;
int n, a;
ll sum;
bool med;
signed main() {
#ifdef FLOZE_TOT
file("");
#endif
read >> n;
_FOR(i, 1, n) {
read >> a;
sum += a;
}
write << sum;
Avada_Kedavra;
}
output_test
#include <bits/stdc++.h>
#define _FOR(i, a, b) for (int(i) = (a); (i) <= (b); ++(i))
#define _FRO(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define _ROF(i, a, b) for (int(i) = (a); (i) >= (b); --(i))
#define mp std::make_pair
#define eb emplace_back
#define pb pop_back
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define _FFF(i, u, e) for (int(i) = head[(u)]; (i); (i) = (e)[(i)].nxt)
#define file(name) \
freopen(name ".in", "r", stdin); \
freopen(name ".out", "w", stdout);
#define fs(x) std::fixed << std::setprecision(x)
#define il inline
#define Avada_Kedavra return 0
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
typedef __int128 i128;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;
typedef std::vector<int> vi;
typedef std::vector<ll> vll;
typedef std::vector<pii> vpii;
typedef std::vector<pll> vpll;
typedef std::stack<int> si;
typedef std::stack<ll> sll;
typedef std::stack<pii> spii;
typedef std::stack<pll> spll;
typedef std::queue<int> qi;
typedef std::queue<ll> qll;
typedef std::queue<pii> qpii;
typedef std::queue<pll> qpll;
typedef std::deque<int> dqi;
typedef std::deque<ll> dqll;
typedef std::deque<pii> dqpii;
typedef std::deque<pll> dqpll;
typedef std::priority_queue<int> pqi;
typedef std::priority_queue<ll> pqll;
typedef std::priority_queue<pii> pqpii;
typedef std::priority_queue<pll> pqpll;
typedef std::set<int> siset;
typedef std::set<ll> sllset;
typedef std::set<pii> spiiset;
typedef std::set<pll> spllset;
typedef std::multiset<int> simset;
typedef std::multiset<ll> sllmset;
typedef std::multiset<pii> spiimset;
typedef std::multiset<pll> spllmset;
typedef std::map<int, int> simap;
typedef std::map<ll, ll> sllmap;
typedef std::map<pii, pii> spiimap;
typedef std::map<pll, pll> spllmap;
typedef std::unordered_set<int> siuset;
typedef std::unordered_set<ll> slluset;
typedef std::unordered_set<pii> spiiuset;
typedef std::unordered_set<pll> splluset;
typedef std::unordered_map<int, int> siumap;
typedef std::unordered_map<ll, ll> sllumap;
typedef std::unordered_map<pii, pii> spiiumap;
typedef std::unordered_map<pll, pll> spllumap;
#define _IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr), std::cout.tie(nullptr)
namespace FastIO {
class FastIOBase {
protected:
#ifdef ONLINE_JUDGE
static const int BUFSIZE = 1 << 16;
char buf[BUFSIZE + 1];
int buf_p = 0;
#endif
FILE *target;
FastIOBase(FILE *f) : target(f) {}
~FastIOBase() = default;
public:
#ifdef ONLINE_JUDGE
virtual void flush() = 0;
#endif
};
class FastOutput final : public FastIOBase {
private:
void __putc(char x) {
#ifdef ONLINE_JUDGE
if (buf[buf_p++] = x, buf_p == BUFSIZE) flush();
#else
putc(x, target);
#endif
}
template <typename T> void __write(T x) {
char stk[std::numeric_limits<T>::digits10 + 1], *top = stk;
if (x < 0) return __putc('-'), __write(-x);
do *(top++) = x % 10, x /= 10;
while (x);
for (; top != stk; __putc(*(--top) + '0'));
}
public:
FastOutput(FILE *f = stdout) : FastIOBase(f) {}
#ifdef ONLINE_JUDGE
~FastOutput() { flush(); }
void flush() { fwrite(buf, 1, buf_p, target), buf_p = 0; }
#endif
FastOutput &operator<< (char x) { return __putc(x), *this; }
FastOutput &operator<< (const char *s) {
for (; *s; __putc(*(s++)));
return *this;
}
FastOutput &operator<< (const std::string &s) {
return (*this) << s.c_str();
}
template <typename T>
std::enable_if_t<std::is_integral<T>::value, FastOutput &> operator<< (const T &x) {
return __write(x), *this;
}
template <typename... T> void writesp(const T &...x) {
std::initializer_list<int>{(this->operator<< (x), __putc(' '), 0)...};
}
template <typename... T> void writeln(const T &...x) {
std::initializer_list<int>{(this->operator<< (x), __putc('\n'), 0)...};
}
template <typename Iter> void writesp(Iter begin, Iter end) {
while (begin != end) (*this) << *(begin++) << ' ';
}
template <typename Iter> void writeln(Iter begin, Iter end) {
while (begin != end) (*this) << *(begin++) << '\n';
}
} qout;
class FastInput final : public FastIOBase {
private:
bool __eof;
public:
FastInput(FILE *f = stdin)
: FastIOBase(f),
__eof(false)
#ifdef ONLINE_JUDGE
{
buf_p = BUFSIZE;
}
void flush() { buf[fread(buf, 1, BUFSIZE, target)] = EOF, buf_p = 0; }
bool eof() const { return buf[buf_p] == EOF; }
#else
{
}
bool eof() const { return feof(target); }
#endif
char get() {
if (__eof) return EOF;
#ifdef ONLINE_JUDGE
if (buf_p == BUFSIZE) flush();
char ch = buf[buf_p++];
#else
char ch = getc(target);
#endif
return ~ch ? ch : (__eof = true, EOF);
}
void unget(char c) {
__eof = false;
#ifdef ONLINE_JUDGE
buf[--buf_p] = c;
#else
ungetc(c, target);
#endif
}
explicit operator bool () const { return !__eof; }
FastInput &operator>> (char &x) {
while (isspace(x = get()));
return *this;
}
template <typename T>
std::enable_if_t<std::is_integral<T>::value, FastInput &> operator>> (T &x) {
char ch, sym = 0;
x = 0;
while (isspace(ch = get()));
if (__eof) return *this;
if (ch == '-') sym = 1, ch = get();
for (; isdigit(ch); x = (x << 1) + (x << 3) + (ch ^ 48), ch = get());
return unget(ch), sym ? x = -x : x, *this;
}
FastInput &operator>> (char *s) {
while (isspace(*s = get()));
if (__eof) return *this;
for (; !isspace(*s) && !__eof; *(++s) = get());
return unget(*s), *s = '\0', *this;
}
FastInput &operator>> (std::string &s) {
char str_buf[(1 << 8) + 1] = {0}, *p = str_buf;
char *const buf_end = str_buf + (1 << 8);
while (isspace(*p = get()));
if (__eof) return *this;
for (s.clear(), p++;; p = str_buf) {
for (; p != buf_end && !isspace(*p = get()) && !__eof; p++);
if (p != buf_end) break;
s.append(str_buf);
}
unget(*p), *p = '\0', s.append(str_buf);
return *this;
}
template <typename... T> void read(T &...x) {
std::initializer_list<int>{(this->operator>> (x), 0)...};
}
template <typename Iter> void read(Iter begin, Iter end) {
while (begin != end) (*this) >> *(begin++);
}
} qin;
} // namespace FastIO
#define read FastIO::qin
#define write FastIO::qout
namespace DEBUG {
#ifndef ONLINE_JUDGE
#define debug(a) std::cerr << "In Line" << __LINE__ << " the " << #a << " = " << a << '\n'
#define look_time std::cerr << clock() * 1e3 / CLOCKS_PER_SEC << " ms\n"
#define look_memory std::cerr << fabs(&med - &mst) / 1024.0 / 1024.0 << " mb\n"
#else
#define debug(...) ((void)0)
#define look_time ((void)0)
#define look_memory ((void)0)
#endif
} // namespace DEBUG
using namespace DEBUG;
namespace basic_algorithm {
template <typename T> il void swap(T &a, T &b) {
T t = a;
a = b, b = t;
}
template <typename T> il T lowbit(T x) { return (x & (-x)); }
template <typename T> il T max(T a, T b) { return a < b ? b : a; }
template <typename T> il T min(T a, T b) { return a > b ? b : a; }
template <typename T, typename... Args> il T max(T a, Args... args) {
return max(a, max(args...));
}
template <typename T, typename... Args> il T min(T a, Args... args) {
return min(a, min(args...));
}
template <typename T> il T abs(T a) { return a >= 0 ? a : -a; }
template <typename T> il T gcd(T a, T b) {
while (b) a %= b, swap(a, b);
return a;
}
template <typename T> il T lcm(T a, T b) { return a / gcd(a, b) * b; }
} // namespace basic_algorithm
using namespace basic_algorithm;
template <ll mod> struct Mint {
ll val;
il Mint(ll v = 0ll) : val((v % mod + mod) % mod) {}
il Mint operator-() const { return Mint(-val); }
il Mint operator+=(const Mint &b) {
if ((val += b.val) >= mod) val -= mod;
return *this;
}
il Mint &operator++() {
val++;
if (val == mod) val = 0;
return *this;
}
il Mint &operator--() {
if (val == 0) val = mod;
val--;
return *this;
}
il Mint operator++(int) {
Mint res = *this;
++*this;
return res;
}
il Mint operator--(int) {
Mint res = *this;
--*this;
return res;
}
il Mint operator-=(const Mint &b) {
if ((val -= b.val) < 0) val += mod;
return *this;
}
il Mint operator*=(const Mint &b) {
val = (val * b.val) % mod;
return *this;
}
il Mint operator/=(const Mint &b) {
return *this *= b.inv();
}
il Mint operator+(const Mint &b) const { return Mint(*this) += b; }
il Mint operator-(const Mint &b) const { return Mint(*this) -= b; }
il Mint operator*(const Mint &b) const { return Mint(*this) *= b; }
il Mint operator/(const Mint &b) const { return Mint(*this) /= b; }
il bool operator==(const Mint &b) const { return val == b.val; }
il bool operator!=(const Mint &b) const { return val != b.val; }
il Mint pow(ll n) const {
assert(n >= 0);
Mint res = 1, w = *this;
for (; n; n >>= 1, w *= w)
if (n & 1) res *= w;
return res;
}
il Mint inv() const { return pow(mod - 2); }
template <typename OUT> il friend OUT &operator<<(OUT &os, const Mint &x) {
return os << x.val;
}
template <typename IN> il friend IN &operator>>(IN &is, Mint &x) {
ll v;
is >> v;
x = Mint(v);
return is;
}
};
const int N = 1e5 + 5;
const int mod = 1e8 + 5;
const double pi = acos(-1.0);
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
const ll inf = 1e18;
typedef Mint<mod> mint;
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
bool mst;
int n;
bool med;
signed main() {
#ifdef FLOZE_TOT
file("");
#endif
read >> n;
_FOR(i, 1, n) write << mod << ' ';
Avada_Kedavra;
}
詳細信息
Subtask #1:
score: 100
Accepted
Test #1:
score: 100
Accepted
time: 183ms
memory: 3784kb
input:
10000000 944414862 991548606 959728917 398088896 452213415 352313823 553837750 493093048 318309502 304689265 225616540 597568598 909602802 860405511 483835764 565015849 204723130 872308100 847920879 406522647 115595422 511095546 898919616 506104643 794831956 777266955 285818601 213114806 955867701 7...
output:
5499171639281345
result:
points 1.0 input test passed
Subtask #2:
score: 100
Accepted
Test #2:
score: 100
Accepted
time: 86ms
memory: 3852kb
input:
10000000
output:
100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 100000005 ...
result:
points 1.0 output test passed