fedor86 is pretty much right. Any other style will not do -
during my BMT, there was one fellow in my platoon who already got
his scuba diving licence, but the only style he knew was freestyle.
Tough luck.
You're not immediately binned if you can't swim - instead, you join
the "water polo team". It's a separate training group for
non-swimmers where they learn the basics. They call it the water
polo team because the trainees wear swimming caps. I've never come
across anybody who's failed that.
Further down the track, you work your way up to a 1500 metre swim
in a pool, probably about the time you're supposed to get your
beret. I'm from the old 2.5 year days, so I don't know how they
schedule things these days - maybe someone who's been there more
recently can shed light on when they presently schedule the 1500
metre swim.
Again, I don't know if the system has changed, but in my day we had
a 1500 open-water swim too for section leaders and boatmen. You
swim in your Number 4 uniform, but it's not as bad as it sounds -
you'll have your life jacket on you, and you can inflate it if you
get into strife.