結果
問題 | No.2416 vs Slime |
ユーザー |
|
提出日時 | 2023-08-12 14:26:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,553 bytes |
コンパイル時間 | 1,491 ms |
コンパイル使用メモリ | 165,840 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-19 19:21:38 |
合計ジャッジ時間 | 2,649 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; /* alias */ // type using ull = unsigned long long; using ll = long long; using ld = long double; // pair using pii = pair<int, int>; // vector using vi = vector<int>; using vl = vector<long>; using vll = vector<ll>; using vvi = vector<vi>; using vvl = vector<vl>; using vvll = vector<vll>; using vs = vector<string>; using vpii = vector<pii>; /* define short */ #define mp make_pair #define all(obj) (obj).begin(), (obj).end() #define YesNo(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;} /* REP macro */ #define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i) #define rep(i, n) reps(i, 0, n) #define rrep(i, n) reps(i, 1, n + 1) #define repd(i,n) for(ll i=n-1;i>=0;i--) #define rrepd(i,n) for(ll i=n;i>=1;i--) //定数 #define inf 2147483647; #define INF 9223372036854775807; /* func */ inline int in_int() {int x; cin >> x; return x;} inline ll in_ll() {ll x; cin >> x; return x;} inline double in_double() {{double x; cin >> x; return x;}} inline string in_str() {string x; cin >> x; return x;} inline int ctoi(char c) {return c - '0';} template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } int main() { ll h, a; cin >> h >> a; ll ans = 1; if (h/a <= 0) { cout << ans << endl; return 0; } ll count = 0; while(true) { count++; ans += count * 2; h/=a; if (h/a <= 0) { cout << ans << endl; break; } } }