This repository has been archived on 2022-06-22. You can view files and clone it, but cannot push or open issues or pull requests.
usaco-guide/content/1_Intro/Languages.md

75 lines
3 KiB
Markdown
Raw Normal View History

2020-06-03 22:48:48 +00:00
---
2020-06-22 19:59:16 +00:00
id: lang
title: Languages
2020-06-17 18:05:19 +00:00
author: Nathan Wang, Benjamin Qi
2020-06-22 20:43:02 +00:00
description: "What languages you can use for programming contests and what you're expected to know before continuing."
2020-06-03 22:48:48 +00:00
---
2020-06-04 05:39:49 +00:00
2020-06-22 03:32:32 +00:00
## Choosing a Language
The most popular languages that USACO supports are [C++11](https://en.wikipedia.org/wiki/C%2B%2B), [Java](https://en.wikipedia.org/wiki/Java_(programming_language)), and [Python 3](https://en.wikipedia.org/wiki/Python_(programming_language)). In general, we recommend the following:
- If you already know one of these languages, just use it.
- If you know multiple languages, we recommend you pick C++ over Java, and Java over Python.
- For Bronze, any language will do.
- For Silver, Gold, and Platinum, Python is not recommended.
Keep in mind that it's easy to switch languages down the road. Don't get caught up on which language to choose. Just pick the one you feel most comfortable with!
### Language References
All of these are provided at the IOI aside from the additional C++ reference.
- [C++](https://en.cppreference.com/w/)
- [Additional C++ Reference](http://www.cplusplus.com/)
- [Java](https://docs.oracle.com/javase/8/docs/api/overview-summary.html)
- [Python3](https://docs.python.org/3/reference/)
2020-06-09 00:47:37 +00:00
## Expected Knowledge
2020-06-07 01:05:28 +00:00
2020-06-22 03:32:32 +00:00
The remainder of this guide assumes that you know the basics of how to code in one of the languages listed above, including the following topics:
2020-06-19 01:15:13 +00:00
2020-06-07 01:05:28 +00:00
- Variables
- Data types
- Reading Input
- Writing Output
- Loops
2020-06-19 01:15:13 +00:00
- If / Else
2020-06-07 01:05:28 +00:00
- Logical operators
- Functions
- Basic Recursion (a function calling itself)
- Arrays
- Multidimensional Arrays
2020-06-22 03:32:32 +00:00
In particular, contestants using Java should be familiar with roughly the first half of AP Computer Science A.
2020-06-19 01:15:13 +00:00
2020-06-22 03:32:32 +00:00
- If you do not meet these prerequisites, see the links below to get started.
- Familiarity with [competition math](https://github.com/bqi343/USACO/blob/master/Resources/Competition%20Math.md) (ex. AIME qualification) is helpful but not required.
2020-06-19 01:15:13 +00:00
2020-06-09 00:47:37 +00:00
## Resources for Learning How to Code
2020-06-03 04:03:02 +00:00
2020-06-08 19:51:58 +00:00
[Sololearn](https://www.sololearn.com/) has courses on C++, Java, and Python. You don't have to complete the full course.
2020-06-06 04:28:54 +00:00
2020-06-22 03:32:32 +00:00
### C++
- We recommend you finish Sololearn up to (but not including) "More on Classes."
- Also see [Ch 2 of PAPS](http://www.csc.kth.se/~jsannemo/slask/main.pdf)
2020-06-06 04:28:54 +00:00
2020-06-22 04:00:36 +00:00
<info-block title="Pro Tip">
You do not need to learn pointers (for now). Knowledge of structs and classes is useful but not required.
</info-block>
2020-06-07 01:29:02 +00:00
2020-06-19 01:15:13 +00:00
## Resources for Getting Started
2020-06-06 04:28:54 +00:00
2020-06-22 03:32:32 +00:00
Note: We don't agree with all views expressed in the links below. Let us know what works (or doesn't) for you.
2020-06-17 18:05:19 +00:00
2020-06-08 19:51:58 +00:00
- [CodeSignal](https://codesignal.com/)
2020-06-17 18:05:19 +00:00
- can practice basics with "Arcade," "Interview Practice"
2020-06-08 19:51:58 +00:00
- [Philippines OI: Prepare](https://noi.ph/prepare/)
2020-06-17 18:05:19 +00:00
- lots of links!
- [IOI - Getting Started](https://ioinformatics.org/page/getting-started/14)
- not so up to date
2020-06-19 01:15:13 +00:00
- [Quora - Schedule for Beginners (Joshua Pan)](https://www.quora.com/What-is-a-good-schedule-to-follow-for-becoming-better-at-competitive-programming-for-beginners)