Submission #19557938


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
using ll = long long; // int64_t
using ull = unsigned long long;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)

const int INF = 1230230230;   //10oku10

map<ll,double> score;

double e3 (double a , double b, double c) {
  ll X = a*1000000+b*1000+c;
  if (score.find(X) != score.end()){
    return score[X];
  }
  if (a == 100 || b == 100 || c == 100) {
    score[X] = 0 ;
    return 0;
  }
  score[X] = e3(a+1 , b,c) * a / (a+b+c) + e3(a , b+1, c ) * b / (a+b+c) + e3(a , b, c +1) * c / (a+b+c) +1;
}

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  double a = A;
  double b = B;
  double c = C;

  cout << e3 (a,b,c) << endl;

}

Submission Info

Submission Time
Task D - increment of coins
User MiyakoTakanashi
Language C++ (GCC 9.2.1)
Score 0
Code Size 812 Byte
Status RE
Exec Time 951 ms
Memory 1051944 KB

Compile Error

./Main.cpp: In function ‘double e3(double, double, double)’:
./Main.cpp:23:12: warning: control reaches end of non-void function [-Wreturn-type]
   23 |   score[X] = e3(a+1 , b,c) * a / (a+b+c) + e3(a , b+1, c ) * b / (a+b+c) + e3(a , b, c +1) * c / (a+b+c) +1;

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
RE × 4
RE × 24
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Case Name Status Exec Time Memory
hand_01.txt RE 951 ms 1051848 KB
hand_02.txt RE 770 ms 1051940 KB
hand_03.txt RE 769 ms 1051816 KB
hand_04.txt RE 767 ms 1051872 KB
hand_05.txt RE 769 ms 1051892 KB
random_01.txt RE 766 ms 1051768 KB
random_02.txt RE 746 ms 1051928 KB
random_03.txt RE 755 ms 1051752 KB
random_04.txt RE 766 ms 1051804 KB
random_05.txt RE 765 ms 1051900 KB
random_06.txt RE 774 ms 1051904 KB
random_07.txt RE 762 ms 1051804 KB
random_08.txt RE 776 ms 1051848 KB
random_09.txt RE 767 ms 1051724 KB
random_10.txt RE 770 ms 1051900 KB
random_11.txt RE 739 ms 1051880 KB
random_12.txt RE 765 ms 1051840 KB
random_13.txt RE 759 ms 1051876 KB
random_14.txt RE 758 ms 1051940 KB
random_15.txt RE 758 ms 1051860 KB
sample_01.txt RE 700 ms 1051852 KB
sample_02.txt RE 700 ms 1051864 KB
sample_03.txt RE 764 ms 1051944 KB
sample_04.txt RE 760 ms 1051888 KB