蒟蒻的答案
查看原帖
蒟蒻的答案
405001
TheSunInTheMorning楼主2020/10/17 10:19

实在是蒟蒻,只能想到这种很麻烦的做法。

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm> 
using namespace std;
int main()
{
	
  int a[8][3];
  int summ , num , t;
  int s=0x3f3f3f3f;
  cin >> t;
  for ( int i = 1 ; i <= 3 ; i++)
    for ( int j=1 ; j<=2 ; j++)
      cin >> a [i][j] ;
      
  for ( int j = 1 ; j <= 3 ;j ++)
  {
    if( t % a[j][1] ==0) num=t/a[j][1];
    else num=t/a[j][1] + 1;
    summ = num * a[j][2];
    if(summ < s) s=summ ;
  }
##   cout<<s;
    return 0;
}
  
   
```而且还不会用floor ,泪目
2020/10/17 10:19
加载中...