martes, 17 de julio de 2012

11734 - Big Number of Teams will Solve This, uva

#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#define db(a) cout << #a << " = " << a << endl
#define db2(a, b) cout << #a << " = " << a << " " << #b << " = " << b << endl
using namespace std;
int main() {
 #ifdef dennisbot
  freopen("in.in", "r", stdin);
  freopen("ou.out", "w", stdout);
 #endif
 int t;
 scanf("%d\n", &t) ;
 char *team, *judge;
 char line[30], line2[30];
 bool wa , pe;
 for (int i = 1; i <= t; i++) {
  gets(line);gets(line2);
  team = line; judge = line2;
  wa = pe = false;
  for ( ; *team && !wa; team++) {
   if (*team == *judge) {
    judge++;
    continue;
   }
   if(*team == ' ') {
    pe = true;
    continue;
   }
   if(*team != *judge) wa = true;
  }
  if (*team != *judge) wa = true;
  
  if (!pe && !wa)
    printf("Case %d: Yes\n", i); 
  else if (wa)
    printf("Case %d: Wrong Answer\n", i); 
   else
    printf("Case %d: Output Format Error\n", i);     
 }
 return 0;
}

No hay comentarios:

Publicar un comentario