Official Analysis (C++)

Implementation

C++

#include <bits/stdc++.h>
using namespace std;
struct State {
int i, j;
int distance;
};
int main() {
int n, d;

Java

import java.io.*;
import java.util.*;
public class Replication {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = sc.nextInt();
int d = sc.nextInt();

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!