結果

問題 No.268 ラッピング(Easy)
ユーザー naimonon77naimonon77
提出日時 2015-10-13 02:27:24
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 785 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 59,580 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-28 12:44:05
合計ジャッジ時間 1,264 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
#include <cstdio>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int l[3];

int tigauyo(int a)
{
   int i,j,k;
   int ans=0;
   for(i=0;i<3;i++) {
      if(i != a) ans += l[i];
   }
   return ans;
}
int main(void)
{
   int i,j,k;
   int memory[2];
   int height[10];
   int n;
   int r,b,y;
   int ans;

   cin >> l[0] >> l[1] >> l[2] ;
   cin >> r >> b >> y ;

   ans = 10000000;

   for(i=0;i<3;i++) {
      for(j=0;j<3;j++) {
         if(i == j) continue;
         for(k=0;k<3;k++) {
            if(i == k || j == k) continue;
            if(r*tigauyo(i)+b*tigauyo(j)+y*tigauyo(k) < ans) {
               ans = r*tigauyo(i)+b*tigauyo(j)+y*tigauyo(k);
            }
         }
      }
   }
   cout << ans*2 << endl;
   return 0;
}
0