結果

問題 No.374 コイン
ユーザー ant2357ant2357
提出日時 2016-06-04 23:25:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,380 bytes
コンパイル時間 759 ms
コンパイル使用メモリ 97,224 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-17 01:20:28
合計ジャッジ時間 3,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>

#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())

#define LL long long
#define LD long double

#define PI 3.14159265358979

using namespace std;
//============================================
// 二分探索
int binary_search(vector<int>ary, int key, int imin, int imax) {
	if (imax < imin) {
		return -1;
	} else {
		int imid = imin + (imax - imin) / 2;
		if (ary[imid] > key) {
			return binary_search(ary, key, imin, imid - 1);
		} else if (ary[imid] < key) {
			return binary_search(ary, key, imid + 1, imax);
		} else {
			return imid;
		}
	}
}

//================================================
int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	string ans;
	double tableA;
	double coin;

	int A, B;
	cin >> A >> B;
	
	tableA = A * A * PI;
	coin = B * B * PI;

	LL i = 2;
	while (tableA > coin) {
		tableA -= coin;
		i++;
	}

	if (i == 2) {
		cout << "K" << "\n";
		return 0;
	}

	if (i % 2 != 0) {
		cout << "K" << "\n";
		return 0;
	} else {
		cout << "S" << "\n";
		return 0;
	}
}
0