Problem 1730. GJam: 2013 Rd1a Bullseye Painting

Google Code Jam 2013 Round 1a Bullseye challenge is to determine how many full rings can be painted given an initial radius and an amount of paint.

Given a radius r, central white zone, create black rings of width 1 cm separated by 1 cm given P ml of paint that covers pi sq-cm per ml of paint provided.

Input: [r, p] Integer values, 1<=r,P<=1000. Always enough P for one ring

Output: Rings


[1 9] 1;
[1 10] 2;
[3 40] 3;
[1 1000000000000000000] 707106780 for Bullseye Large Number Challenge

Google Code Jam:

The next competition starts in April 2014. See details from above link.

This contest does not discriminate by age or against the superiority of Matlab, unlike ACM. Forty-seven Matlab contestants in GJam 2013 out of 21,273.

Solutions to the various past Challenges in Matlab can be found via GJam Solutions.

The Challenges have subsets with Large Number aspects which appear to favor C and Java. Binbin Qi is our last hope with his expertise in Matlab/Java BigInteger.

Related Challenges:

1) Reading 64 bit input file
2) Bullseye Large Numbers r<1E18, P<2E18

Usage of regexp is verboten

Solution Stats

64.81% Correct | 35.19% Incorrect
Last solution submitted on Sep 01, 2016
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more