cmdrdats / store-credit Goto Github PK
View Code? Open in Web Editor NEWGoogle CodeJam store-credit
Home Page: http://code.google.com/codejam/contest/351101/dashboard#s=p0
Google CodeJam store-credit
Home Page: http://code.google.com/codejam/contest/351101/dashboard#s=p0
Problem You receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of all available items. From this list you would like to buy two items that add up to the entire value of the credit. The solution you provide will consist of the two integers indicating the positions of the items in your list (smaller number first). Input The first line of input gives the number of cases, N. N test cases follow. For each test case there will be: One line containing the value C, the amount of credit you have at the store. One line containing the value I, the number of items in the store. One line containing a space separated list of I integers. Each integer P indicates the price of an item in the store. Each test case will have exactly one solution. Output For each test case, output one line containing "Case #x: " followed by the indices of the two items whose price adds up to the store credit. The lower index should be output first. Limits 5 ≤ C ≤ 1000 1 ≤ P ≤ 1000 Small dataset N = 10 3 ≤ I ≤ 100 Large dataset N = 50 3 ≤ I ≤ 2000 Sample Input 3 100 3 5 75 25 200 7 150 24 79 50 88 345 3 8 8 2 1 9 4 4 56 90 3 Output Case #1: 2 3 Case #2: 1 4 Case #3: 4 5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.