点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 其他页面 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

From VijosGuest0
修改单词
讨论 Discussion
 
666
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("p10.in","r",stdin);
freopen("p10.out","w",stdout);
int n,a[10000]={0},i=2,t=2,k,j,q=0;
cin>>n;
a[1]=2;
a[2]=3;
if(n==1||n==2)cout<<a[n];
for(j=2;j<=10000;j++){
k=0;
for(j=1;j<=2;j++){
k++;
a[i+1]=a[i]+t;
i++;
if(i==n){q=1;
cout<<a[i];break;
}
if(k==2)t++;
}
if(q==1)break;
}
fclose(stdin);
fclose(stdout);
return 0;
}
( )

fgeryry
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
  freopen("p1674.in","r",stdin);
  freopen("p1674.out","w",stdout);
  int n;
  cin >> n;
  int cost1, cost2, cost3;
  int num1, price1;
  cin >> num1 >> price1;
  int count1 = (n + num1 - 1) / num1;
  cost1 = count1 * price1;
  int num2, price2;
  cin >> num2 >> price2;
  int count2 = (n + num2 - 1) / num2;
  cost2 = count2 * price2;
  int num3, price3;
  cin >> num3 >> price3;
  int count3 = (n + num3 - 1) / num3;
  cost3 = count3 * price3;
  int min_cost = min(min(cost1, cost2), cost3);
  cout << min_cost << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
( )
发布讨论主题 回复讨论主题
Flag
  
题号
  P1055
  其它
通过
  0人
提交
  70次
通过率
  0%
难度
  2
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1368 | Online Users / Processes : 0 / 46 | Processed Time : 514 ms | Server Time : 2026/3/16 2:59:14