The logarithm of 1-octanol/water partition coefficient (LogP) is one of the most important molecular design parameters in drug discovery. Assuming that LogP can be calculated from the difference between the solvation free energy of a molecule in water and that in 1-octanol, we propose a method for predicting the molecular LogP values based on the extended solvent-contact model. To obtain the molecular solvation free energy data for the two solvents, a proper potential energy function was defined for each solvent with respect to atomic distributions and three kinds of atomic parameters. Total 205 atomic parameters were optimized with the standard genetic algorithm using the training set consisting of 139 organic molecules with varying shapes and functional groups. The LogP values estimated with the two optimized solvation free energy functions compared reasonably well with the experimental results with the associated squared correlation coefficient and root mean square error of 0.824 and 0.697, respectively. Besides the prediction accuracy, the present method has the merit in practical applications because molecular LogP values can be computed straightforwardly from the simple potential energy functions without the need to calculate various molecular descriptors. The methods for enhancing the accuracy of the present prediction model are also discussed.