The contest is over! The final leaderboard and editorials will be released later this week. Thank you to all competitors for participating in the first-ever Phillips Andover Programming Competition!
A contest designed for and by Andover students. Sign up no matter your experience in competitive programming!
Amazon Gift Cards for top 5 scorers!
1st: $50
2nd: $40
3rd: $30
4th: $20
5th: $15
Some instructions for how to read inputs and print outputs Python
a = input()
reads a line of input and stores it as a string at "a" So if you want to read a input like
12 34 53
Just do
inp = input()
inp_split = inp.split(' ')
a = int(inp_split[0])
b = int(inp_split[1])
c = int(inp_split[2])
To output things, use
print(a)
to output a string "a" on a line.
Java
There are multiple ways using System.in
stream. My preferred method is:
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
a = f.readLine();
"f.readLine()" reads a line of input as string and stores it in "a". To output, simply use
System.out.println(a);
to print a line of output "a"
C++
string value;
cin >> value; // takes in the value input
cout << value;
You MAY look up ways to get inputs on the internet. You MAY use API references for your language. However, we trust you not to look up particular algorithms and problems.