結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
takatowin
|
| 提出日時 | 2017-01-23 01:14:20 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 526 bytes |
| 記録 | |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 38,268 KB |
| 最終ジャッジ日時 | 2026-02-24 00:07:20 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 4 WA * 25 |
ソースコード
#include<stdio.h>
#include<string.h>
void sort(int* a,int* b,int* c){
int temp;
if(a>b){
temp=*a;
*a=*b;
*b=temp;
}
if(b>c){
temp=*b;
*b=*c;
*c=temp;
}
}
int main(void){
int r,g,b,n=0;
scanf("%d %d %d",&r,&g,&b);
sort(&r,&g,&b);
if(r==0){
printf("0\n");
return 0;
}
n=r;
g-=r;
b-=r;
r=0;
while(g>=2){
g-=2;
b--;
n++;
}
if(g==1){
if(b>2){
b-=2;
n++;
}
}
while(b>4){
b-=4;
n++;
}
printf("%d\n",n );
return 0;
}
takatowin