Compote
codeforces-746a
Just go straight to the right scale.
Originally the Code of WA: Qaq wrote the complex ...
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int A,b,c,i,j,k,ans;
scanf ("%d%d%d", &a,&b,&c);
I=a;
J=B/2;
K=C/4;
if (i==0| | j==0| | k==0)
printf ("0\n");
if (i!=0&&j!=0&&k!=0)
{
if ((i==j==k) | | | (i<j&&i<k) | | (i==j&&i<k) | | (i==k&&i<j) | | (J==k&&j>i))
Ans=7*i;
if ((j<i&&j<k) | | | (i==k&&i>j) | | (J==k&&j<i))
Ans=7*j;
if ((k<i&&k<j) | | | (i==j&&i>k))
Ans=7*k;
printf ("%d", ans);
}
return 0;
}
Later, the refined code was modified:
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int a,b,c,i,j,k,min;
scanf ("%d%d%d", &a,&b,&c);
I=a;
J=B/2;
K=C/4;
Min=i;
if (j<min)
Min=j;
if (k<min)
Min=k;
printf ("%d\n", min*7);
return 0;
}
Later, by querying the code that was AC by other means:
Using a fast line or C + + can make the program more concise, but I will not qaq, to continue to refuel!
#include <stdio.h>
#include <stdlib.h>
int MAX (int a,int b)
{
return a>b? A:B;
}
int main ()
{
int a,b,c,i;
int ans=0;
scanf ("%d%d%d", &a,&b,&c);
for (i=1; i<=a; i++)
{
if (b>=2*i&&c>=4*i)
{
Ans=max (ans,i+2*i+4*i);
}
}
printf ("%d\n", ans);
return 0;
}
Compote codeforces-746a is also a flood problem ~~~~~