結果

問題 No.1101 鼻水
ユーザー ブルーレヰブルーレヰ
提出日時 2020-07-03 22:42:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 3,498 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 200,872 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 05:45:40
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
// #include <boost/range/irange.hpp>
// #define RANGE_1(e) (boost::irange(0,(e)))
// #define RANGE_2(s,e) (boost::irange((s),(e)))
// #define RANGE_3(s,e,step) (boost::irange((s),(e),(step)))
// #define RANGE_SELECTER(_1,_2,_3,SELECT,...) SELECT
// #define range(...) RANGE_SELECTER(__VA_ARGS__, RANGE_3, RANGE_2, RANGE_1) (__VA_ARGS__)
#define guard(x) if(x);
#define CINS(x) for(auto&& AJNAD:(x))cin>>AJNAD
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define CALL(x) (x).cbegin(),(x).cend()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define BIT(n) (1LL<<(n))
#define MOD 1000000007

using namespace std;
using lint = long long;

template<class T>class irange{private:struct I{T x;T operator*(){return x;}bool operator!=(I&lhs){return x<lhs.x;}void operator++(){++x;}};I i,n;public:irange(T i,T n):i({i}),n({n}){}I&begin(){return i;}I&end(){return n;}};
template<class T>class srange{private:struct I{T x,s;T operator*(){return x;}bool operator!=(I&lhs){if(s<(T)0)return x>lhs.x;return x<lhs.x;}void operator++(){x=x+s;}};I i,n;public:srange(T i,T n,T s):i({i,s}),n({n,s}){}I&begin(){return i;}I&end(){return n;}};
template<class T>irange<T>range(T n){return irange<T>(0,n);}template<class T>irange<T>range(T i,T n){return irange<T>(i,n);}template<class T>srange<T>range(T i,T n,T s){return srange<T>(i,n,s);}
template<class T>bool amax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool amin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

template<int M> struct modint {
    lint val;
    constexpr modint(lint v = 0)noexcept:val(v%M){if(val<0)val+=M;}
    constexpr int getM(){return M;}
    constexpr modint operator-()const noexcept{return val?M-val:0;}
    constexpr modint operator+(const modint& r)const noexcept{return modint(*this)+=r;}
    constexpr modint operator-(const modint& r)const noexcept{return modint(*this)-=r;}
    constexpr modint operator*(const modint& r)const noexcept{return modint(*this)*=r;}
    constexpr modint operator/(const modint& r)const noexcept{return modint(*this)/=r;}
    constexpr modint& operator+=(const modint& r)noexcept{val+=r.val;if(val>=M)val-=M;return *this;}
    constexpr modint& operator-=(const modint& r)noexcept{val-=r.val;if(val<0)val+=M;return *this;}
    constexpr modint& operator*=(const modint& r)noexcept{val=val*r.val%M;return *this;}
    constexpr modint& operator/=(const modint& r)noexcept{lint a=r.val,b=M,u=1,v=0;while(b){lint t=a/b;a-=t*b;swap(a,b);u-=t*v;swap(u,v);}val=val*u%M;if(val<0)val+=M;return *this;}
    constexpr bool operator==(const modint& r)const noexcept{return this->val==r.val;}
    constexpr bool operator!=(const modint& r)const noexcept {return this->val!=r.val;}
    friend constexpr istream& operator>>(istream &is,modint<M>& x)noexcept{return is>>x.val;}
    friend constexpr ostream& operator<<(ostream &os,const modint<M>& x)noexcept{return os<<x.val;}
    friend constexpr modint<M> Mpow(const modint<M> &a,lint n)noexcept{if(n == 0)return 1;auto t=Mpow(a,n/2);t=t*t;if(n&1)t=t*a;return t;}
};

struct initialize{initialize(){cin.tie(nullptr);ios::sync_with_stdio(false);};}init;

int main(){
    /* Code Area */
    lint V, T, P;
    cin >> V >> T >> P;

    V = V * (P + 1LL);

    lint d = T - 1LL;

    lint q = V / d;
    lint m = V % d;

    lint ans;

    if (m == 0) {
      ans = T * q;
    } else {
      ans = T * q + m + 1LL;
    }

    cout << ans << endl;
}
0