Submission #3010242
Source Code Expand
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typedef pair<ll,ll> ii; typedef vector<int> vi; typedef long double ld; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; typedef set<int>::iterator sit; typedef map<int,int>::iterator mit; typedef vector<int>::iterator vit; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll k,a,b; cin>>k>>a>>b; if(a<=b) { if(a>=k) { cout<<1<<'\n'; } else { cout<<-1<<'\n'; } return 0; } ll tmp = 2LL*((max(k-a,0LL)+a-b-1)/(a-b))+1; ll tmp2 = 2LL*((k+a-b-1)/(a-b)); cout<<min(tmp,tmp2)<<'\n'; }
Submission Info
Submission Time | |
---|---|
Task | A - Kaiden |
User | fxt |
Language | C++ (GCC 5.4.1) |
Score | 100 |
Code Size | 910 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 |