結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
misora192
|
| 提出日時 | 2020-06-16 23:29:32 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 5,000 ms |
| + 136µs | |
| コード長 | 688 bytes |
| 記録 | |
| コンパイル時間 | 905 ms |
| コンパイル使用メモリ | 187,772 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-19 05:17:52 |
| 合計ジャッジ時間 | 2,700 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
vector<int> a(3);
rep(i, 3) cin >> a[i];
sort(a.begin(), a.end());
int ans = a[0];
rep(i, 3) a[2 - i] -= a[0];
int x = a[1], y = a[2];
while(x >= 1 && y >= 3){
x--;
y -= 3;
ans++;
if(x > y) swap(x, y);
}
if(x == 0){
ans += y / 5;
}
cout << ans << endl;
}
misora192