結果
| 問題 |
No.268 ラッピング(Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-27 04:34:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 322 bytes |
| コンパイル時間 | 2,191 ms |
| コンパイル使用メモリ | 194,752 KB |
| 最終ジャッジ日時 | 2025-01-10 02:24:53 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | rep(i,3) scanf("%d",&a[i]);
| ~~~~~^~~~~~~~~~~~
main.cpp:10:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | rep(i,3) scanf("%d",&b[i]);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int a[3],b[3];
rep(i,3) scanf("%d",&a[i]);
rep(i,3) scanf("%d",&b[i]);
int c[3]={2*(a[0]+a[1]),2*(a[0]+a[2]),2*(a[1]+a[2])};
sort(b,b+3);
sort(c,c+3);
printf("%d\n",b[0]*c[2]+b[1]*c[1]+b[2]*c[0]);
return 0;
}