ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1644. A Whole Lot of Walnuts

Почему не проходит!!!!
Posted by Kvasela 30 Mar 2012 18:44
#include <iostream>
#include <string.h>
using namespace std;
void main()
{
int exp = 0;
char fast[10];
int optimal = 0;
int no_optimal = 0;
int gorih;
cin >> exp;
for(int i = 1; i <= exp; i++)
{
cin >> gorih;
cin>>fast;
if(!strcmp(fast,"satisfied"))
{ if(optimal > gorih)
{ optimal = gorih;}if(optimal == 0){optimal=gorih;}}
else {if(no_optimal==0){no_optimal=gorih;}if(no_optimal<gorih){no_optimal=gorih;}}
}
if(optimal == 0){cout<<"Inconsistent";}
else if(optimal>no_optimal){ cout<<optimal;}
else {cout<<"Inconsistent";}
}
Re: Почему не проходит!!!!
Posted by Andrew Sboev 28 Apr 2012 18:38
It is known as a fact, that ten walnuts is always enough and two walnuts are always not enough.