Submission #3026379


Source Code Expand

//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;
typedef string::const_iterator State;

int dy[5] = { 0,0,1,-1,0 };
int dx[5] = { 1,-1,0,0 ,0 };




int main(void) {
	
	long long int k, a, b;
	long long int now = 0;
	long long int count = -1;

	cin >> k >> a >> b;

	now += a;

	if (a - b <= 0) {
		count = -1;
	}
	else if (now >= k) {
		count = 1;
	}
	else {
		b = a - b;
		if ((k - now) % b == 0) {
			count = ((k - now) / b) * 2 + 1;
		}
		else {
			count = ((k - now) / b + 1) * 2 + 1;
		}

	}
	cout << count << endl;
	

	

	return 0;
}

Submission Info

Submission Time
Task A - Kaiden
User yukiteru
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1381 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
AC × 3
AC × 10
WA × 3
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 WA 1 ms 256 KB
b05 WA 1 ms 256 KB
b06 AC 1 ms 256 KB
b07 WA 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