USACO Silver 2016 Open - Diamond Collector
Authors: Nathan Wang, Albert Ye
Appears In
C++
Implementation
#include <bits/stdc++.h>using namespace std;int main() {freopen("diamond.in", "r", stdin);freopen("diamond.out", "w", stdout);int n, k; cin >> n >> k;int A[n];
Java
Implementation
Source: Nick Wu, from the official USACO editorial
import java.io.*;import java.util.*;public class diamondS {public static void main(String[] args) throws IOException {BufferedReader br = new BufferedReader(new FileReader("diamond.in"));PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("diamond.out")));StringTokenizer st = new StringTokenizer(br.readLine());int n = Integer.parseInt(st.nextToken());int k = Integer.parseInt(st.nextToken());int[] list = new int[n];
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!