Submission #42119791
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// Template {{{
#define REP(n) for (int _ = 0; _ < (n); _++)
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
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;
}
namespace std {
template <class Fun>
class y_combinator_result {
Fun fun_;
public:
template <class T>
explicit y_combinator_result(T &&fun) : fun_(std::forward<T>(fun)) {}
template <class... Args>
decltype(auto) operator()(Args &&...args) {
return fun_(std::ref(*this), std::forward<Args>(args)...);
}
};
template <class Fun>
decltype(auto) y_combinator(Fun &&fun) {
return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
}
} // namespace std
#define DEBUG(x) cerr << #x << ": " << x << '\n'
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T_container, typename T = typename enable_if<
!is_same<T_container, string>::value,
typename T_container::value_type>::type>
ostream &operator<<(ostream &os, const T_container &v) {
os << '[';
string sep;
for (const T &x : v) os << sep << x, sep = ", ";
return os << ']';
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// }}}
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int N; cin >> N;
if (N % 5 <= 2) cout << (N - N%5) << '\n';
else cout << (N + (5-(N%5))) << '\n';
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Water Station |
| User | silxikys |
| Language | C++ (GCC 9.2.1) |
| Score | 100 |
| Code Size | 1939 Byte |
| Status | AC |
| Exec Time | 17 ms |
| Memory | 3636 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 17 ms | 3516 KiB |
| 00_sample_01.txt | AC | 2 ms | 3568 KiB |
| 00_sample_02.txt | AC | 2 ms | 3528 KiB |
| 01_random_03.txt | AC | 2 ms | 3636 KiB |
| 01_random_04.txt | AC | 2 ms | 3528 KiB |
| 01_random_05.txt | AC | 2 ms | 3584 KiB |
| 01_random_06.txt | AC | 2 ms | 3520 KiB |
| 01_random_07.txt | AC | 2 ms | 3476 KiB |
| 01_random_08.txt | AC | 2 ms | 3528 KiB |
| 01_random_09.txt | AC | 2 ms | 3460 KiB |