domingo, 23 de junio de 2013

Codeforces Round #189

That was a bad Code Forces Round, I only solved the easy problem, the A.

Here is my solution.
int main() {
  int n;
  scanf("%d", &n);

  while(true) {
    bool sw = true;

    if(n%1000 == 144) {
      n /= 1000;
      sw = false;
    }

    if(n%100 == 14) {
      n /= 100;
      sw = false;
    }

    if(n%10 == 1) {
      n /= 10;
      sw = false;
    }

    if(sw)
      break;
  }

  if(n == 0)
    printf("YES\n");
  else
    printf("NO\n");

  return 0;
}
Fine, to day will be a long day, cause less one hour is the June Cook-Off and later the 2th Online Programming Contest of Bolivia.

Bye ...