結果

問題 No.604 誕生日のお小遣い
ユーザー zeke
提出日時 2019-09-24 17:05:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,554 bytes
コンパイル時間 601 ms
コンパイル使用メモリ 84,240 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 19:30:34
合計ジャッジ時間 1,416 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <limits>
using ll = long long;
using ld = long double;
int MOD = 1e9 + 7;
using namespace std;
struct UnionFind
{
vector<int> par; // par[i]:i () par[3] = 2 : 32
UnionFind(int N) : par(N)
{ //
for (int i = 0; i < N; i++)
par[i] = i;
}
int root(int x)
{ // xroot(x) = {x}
if (par[x] == x)
return x;
return par[x] = root(par[x]);
}
void unite(int x, int y)
{ // xy
int rx = root(x); //xrx
int ry = root(y); //yry
if (rx == ry)
return; //xy(=)
par[rx] = ry; //xy(=)xrxyry
}
bool same(int x, int y)
{ // 2x, ytrue
int rx = root(x);
int ry = root(y);
return rx == ry;
}
};
int main()
{
ll a,b,c;
cin>>a>>b>>c;
ll k = a - 1 + b;
ll m = c / k;
ll n = c % k;
if(n<=a-1){
cout << m*a + n << endl;
}else{
cout << m*a + a << endl;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0