結果

問題 No.920 あかあお
ユーザー watasihakodamawatasihakodama
提出日時 2019-11-08 22:26:01
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 1,142 bytes
コンパイル時間 1,306 ms
コンパイル使用メモリ 107,028 KB
実行使用メモリ 74,116 KB
最終ジャッジ日時 2023-08-20 13:23:54
合計ジャッジ時間 2,838 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
74,040 KB
testcase_01 AC 64 ms
74,016 KB
testcase_02 AC 64 ms
73,976 KB
testcase_03 AC 64 ms
74,004 KB
testcase_04 AC 64 ms
74,116 KB
testcase_05 AC 65 ms
74,012 KB
testcase_06 AC 64 ms
73,984 KB
testcase_07 AC 64 ms
73,988 KB
testcase_08 AC 64 ms
73,992 KB
testcase_09 AC 64 ms
74,024 KB
testcase_10 AC 64 ms
73,980 KB
testcase_11 AC 65 ms
73,988 KB
testcase_12 AC 64 ms
74,052 KB
testcase_13 AC 65 ms
74,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
const long long INF=200000000000000;
double pi=3.141592653589793;

const int MOD = 1000000007;

long long gcd(long long a,long long b){
	if(a<b)swap(a,b);
	if(a%b==0)return b;
	return gcd(a%b,b);
}

long long lcm(long long a,long long b){
	return a/gcd(a,b)*b;
}
long myPow(long long x, long long n, long long m=MOD){
  if(n == 0)
    return 1;
  if(n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}

ll N;
vector<double>p(3002);
vector<vector<double>>memo(3002,vector<double>(3002,-1));
double f(double i,double j){
	if(memo[i][j]!=-1)return memo[i][j];
	if(i==0){
		if(j==0)return 1;
		else return 0;
	}
	return memo[i][j]=(1-p[i-1])*f(i-1,j)+p[i-1]*f(i-1,j-1);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	ll X,Y,Z;
	cin>>Z>>Y>>X;
	ll ans=0;
	for(ll i=0;i<=X;i++){
		ans=max(ans,min(Y+i,Z+X-i));
	}
	cout<<ans<<endl;
}
0