Блог пользователя accidentallygivenfuck

Автор accidentallygivenfuck, история, 7 лет назад, По-английски

My following solution for Leapfrog: Ch. 1 failed:

#include <iostream>
#include <string>
using namespace std;

int T;

int main() {
  cin >> T;
  
  for (int test = 1; test <= T; ++test)
  {
    string s;
    cin >> s;

    int n = s.length();
    int b = 0;
    for (int i = 0; i < n; i++)
      if (s[i] == 'B')
        b++;

    char yesno = ( b+1 <= n-1 && n-1 <= 2*b ?'Y' :'N');
    cout << "Case #" << test << ": " << yesno << "\n";
  }

  return 0;
}

I compared the outputs for the reference solution and mine. But they are the same. diff doesn't find any differences.

Here is the Dropbox folder with my and reference solution's sources, inputs and outputs. I don't believe I submitted the wrong files.

Can someone confirm or reject the validity of my solution?

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You can actually download files you submitted btw

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Well I had my both conditions same as yours and the solution passed.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

According to our records, it looks like your Leapfrog: Ch. 1 submission did pass, while your Leapfrog: Ch. 2 submission did not. Are you sure your scoreboard indicates that you failed both problems?