Submission #5990707
Source Code Expand
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <deque> #include <queue> #include <array> #include <set> #include <map> #include <cmath> #include <algorithm> #include <numeric> #include <cassert> #include <utility> #include <functional> #include <bitset> #include <cstdint> using namespace std; using i64 = int64_t; using i32 = int32_t; template<class T, class U> void init_n(vector<T>& v, size_t n, U x) { v = vector<T>(n, x); } template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); } template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) { v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; } template<class T> void read_n(T a[], size_t n, size_t o = 0) { for (size_t i=o; i<n+o; ++i) cin >> a[i]; } template<class T> T gabs(const T& x) { return max(x, -x); } #define abs gabs int main() { i64 k, a, b; cin >> k >> a >> b; if (a >= k) cout << 1 << endl; else if (b >= a) cout << -1 << endl; else cout << (k - a + (a - b - 1)) / (a - b) * 2 + 1 << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Kaiden |
User | cottoncotton |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1106 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | a01, a02, a03 |
All | a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
a01 | AC | 1 ms | 256 KB |
a02 | AC | 1 ms | 256 KB |
a03 | AC | 1 ms | 256 KB |
b04 | AC | 1 ms | 256 KB |
b05 | AC | 1 ms | 256 KB |
b06 | AC | 1 ms | 256 KB |
b07 | AC | 1 ms | 256 KB |
b08 | AC | 1 ms | 256 KB |
b09 | AC | 1 ms | 256 KB |
b10 | AC | 1 ms | 256 KB |
b11 | AC | 1 ms | 256 KB |
b12 | AC | 1 ms | 256 KB |
b13 | AC | 1 ms | 256 KB |