QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#73427 | #5266. Absolutely Flat | sinbad | AC ✓ | 3ms | 3416kb | C++ | 4.2kb | 2023-01-25 12:51:19 | 2023-01-25 12:51:21 |
Judging History
answer
#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const multiset<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
template <class T> auto vect(const T& v, int n) { return vector<T>(n, v); }
template <class T, class... D> auto vect(const T& v, int n, D... m) {
return vector<decltype(vect(v, m...))>(n, vect(v, m...));
}
using int64 = long long;
using int128 = __int128_t;
using ii = pair<int, int>;
#define SZ(x) (int)((x).size())
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
mt19937_64 mrand(random_device{}());
int64 rnd(int64 x) { return mrand() % x; }
constexpr inline int lg2(int64 x) { return x == 0 ? -1 : sizeof(int64) * 8 - 1 - __builtin_clzll(x); }
constexpr inline int p2ceil(int64 x) { return 1 << (lg2(x - 1) + 1); }
template <class T> void out(const vector<T>& a) { for (int i = 0; i < SZ(a); ++i) cout << a[i] << " \n"[i + 1 == SZ(a)]; }
template <class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template <class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template <class T> void dedup(vector<T>& v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); }
inline void add_mod(int& x, int y) { x += y; if (x >= MOD) x -= MOD; }
inline void sub_mod(int& x, int y) { x += MOD - y; if (x >= MOD) x -= MOD; }
inline int mod(int x) { return x >= MOD ? x - MOD : x; }
struct fast_ios {
fast_ios() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
};
} fast_ios_;
int main() {
vector<int> a(4);
for (int i = 0; i < 4; ++i) cin >> a[i];
bool found = 0;
bool ok = 1;
for (int i = 1; i < 4; ++i) {
if (a[i] != a[0]) ok = 0;
}
if (ok) found = 1;
int x;
cin >> x;
for (int i = 0; i < 4; ++i) {
a[i] += x;
bool ok = 1;
for (int j = 1; j < 4; ++j) {
if (a[j] != a[0]) ok = 0;
}
if (ok) {
found = 1;
break;
}
a[i] -= x;
}
cout << found << '\n';
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3308kb
input:
10 10 10 10 5
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3328kb
input:
13 13 5 13 8
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
50 42 42 50 8
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3324kb
input:
20 40 10 30 2
output:
0
result:
ok 1 number(s): "0"
Test #5:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
1 1 1 1 1
output:
1
result:
ok 1 number(s): "1"
Test #6:
score: 0
Accepted
time: 3ms
memory: 3368kb
input:
7 3 8 9 1
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
26 72 52 80 74
output:
0
result:
ok 1 number(s): "0"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
99 98 96 94 91
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
100 100 100 99 100
output:
0
result:
ok 1 number(s): "0"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3340kb
input:
100 100 100 100 100
output:
1
result:
ok 1 number(s): "1"
Test #11:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
7 7 7 7 3
output:
1
result:
ok 1 number(s): "1"
Test #12:
score: 0
Accepted
time: 2ms
memory: 3312kb
input:
26 26 26 26 72
output:
1
result:
ok 1 number(s): "1"
Test #13:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
99 99 99 99 98
output:
1
result:
ok 1 number(s): "1"
Test #14:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
10 62 62 62 52
output:
1
result:
ok 1 number(s): "1"
Test #15:
score: 0
Accepted
time: 2ms
memory: 3308kb
input:
3 1 3 3 2
output:
1
result:
ok 1 number(s): "1"
Test #16:
score: 0
Accepted
time: 1ms
memory: 3368kb
input:
34 34 5 34 29
output:
1
result:
ok 1 number(s): "1"
Test #17:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
69 69 69 10 59
output:
1
result:
ok 1 number(s): "1"
Test #18:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
4 94 94 94 90
output:
1
result:
ok 1 number(s): "1"
Test #19:
score: 0
Accepted
time: 2ms
memory: 3376kb
input:
96 33 96 96 63
output:
1
result:
ok 1 number(s): "1"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3412kb
input:
94 94 54 94 40
output:
1
result:
ok 1 number(s): "1"
Test #21:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
96 96 96 92 4
output:
1
result:
ok 1 number(s): "1"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3388kb
input:
73 73 65 73 8
output:
1
result:
ok 1 number(s): "1"
Test #23:
score: 0
Accepted
time: 2ms
memory: 3392kb
input:
9 9 9 7 1
output:
0
result:
ok 1 number(s): "0"
Test #24:
score: 0
Accepted
time: 1ms
memory: 3376kb
input:
44 42 43 44 1
output:
0
result:
ok 1 number(s): "0"
Test #25:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
79 79 79 59 5
output:
0
result:
ok 1 number(s): "0"
Test #26:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
5 7 11 11 2
output:
0
result:
ok 1 number(s): "0"
Test #27:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
36 36 24 36 6
output:
0
result:
ok 1 number(s): "0"
Test #28:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
54 81 54 72 9
output:
0
result:
ok 1 number(s): "0"
Test #29:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
13 1 4 10 3
output:
0
result:
ok 1 number(s): "0"
Test #30:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
47 47 46 43 1
output:
0
result:
ok 1 number(s): "0"
Test #31:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
65 65 67 67 2
output:
0
result:
ok 1 number(s): "0"
Test #32:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
40 34 36 36 2
output:
0
result:
ok 1 number(s): "0"
Test #33:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
19 19 31 23 2
output:
0
result:
ok 1 number(s): "0"
Test #34:
score: 0
Accepted
time: 0ms
memory: 3308kb
input:
83 74 68 77 3
output:
0
result:
ok 1 number(s): "0"
Test #35:
score: 0
Accepted
time: 0ms
memory: 3336kb
input:
6 6 6 6 7
output:
1
result:
ok 1 number(s): "1"
Test #36:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
1 1 1 1 3
output:
1
result:
ok 1 number(s): "1"
Test #37:
score: 0
Accepted
time: 0ms
memory: 3312kb
input:
3 3 3 3 3
output:
1
result:
ok 1 number(s): "1"
Test #38:
score: 0
Accepted
time: 0ms
memory: 3300kb
input:
39 27 37 29 2
output:
0
result:
ok 1 number(s): "0"
Test #39:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
75 75 75 75 14
output:
1
result:
ok 1 number(s): "1"
Test #40:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
5 11 11 11 6
output:
1
result:
ok 1 number(s): "1"
Test #41:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
46 20 46 46 26
output:
1
result:
ok 1 number(s): "1"
Test #42:
score: 0
Accepted
time: 0ms
memory: 3320kb
input:
56 56 81 81 25
output:
0
result:
ok 1 number(s): "0"
Test #43:
score: 0
Accepted
time: 2ms
memory: 3320kb
input:
13 13 11 13 2
output:
1
result:
ok 1 number(s): "1"
Test #44:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
11 45 11 45 34
output:
0
result:
ok 1 number(s): "0"
Test #45:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
84 32 32 84 52
output:
0
result:
ok 1 number(s): "0"
Test #46:
score: 0
Accepted
time: 1ms
memory: 3340kb
input:
9 9 9 16 7
output:
0
result:
ok 1 number(s): "0"
Test #47:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
51 51 51 40 11
output:
1
result:
ok 1 number(s): "1"
Test #48:
score: 0
Accepted
time: 2ms
memory: 3304kb
input:
60 82 82 60 22
output:
0
result:
ok 1 number(s): "0"
Test #49:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
97 15 97 15 82
output:
0
result:
ok 1 number(s): "0"
Test #50:
score: 0
Accepted
time: 2ms
memory: 3320kb
input:
23 23 37 23 14
output:
0
result:
ok 1 number(s): "0"
Test #51:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
68 68 13 13 55
output:
0
result:
ok 1 number(s): "0"
Test #52:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
1 4 1 1 3
output:
0
result:
ok 1 number(s): "0"
Test #53:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
35 32 32 32 3
output:
0
result:
ok 1 number(s): "0"
Test #54:
score: 0
Accepted
time: 0ms
memory: 3308kb
input:
16 16 16 16 58
output:
1
result:
ok 1 number(s): "1"