文字列と配列操作に関するアルゴリズム解析
コードのマクロ定義とフレームワークの約束
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios::sync_with_stdio(false); cin.tie(nullptr);
#define ENDL '\n'
#define RANGE(_x, _y) (_x).begin(), (_x).end()
#define LOOP(_i, _s, _e) for (int _i = _s; _i < _e; ++_i)
typedef long long ll;
const int MAXN = 200010;
signed main() {
...
8月2日 05:41 投稿
小白月赛47 解説と実装
A. ボール詰めゲーム
円柱に詰め込めるボールの体積を求める。円柱の体積は πr²h、各ボールの体積は 4/3 πr³。高さ h の中に収まるボール数は ⌊h/(2r)⌋ 個なので、答えは
πr²h − ⌊h/(2r)⌋ · 4/3 πr³
である。計算量は O(1)。
#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
int main() {
ios::sync_with_stdio(fals ...
7月14日 22:37 投稿