CSES - Array Description

Authors: Andrew Wang, Sofia Yang


Editorial (icecuber)

Implementation

Time Complexity: O(NM)\mathcal{O}(NM)

C++

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
#define pb push_back
#define pi pair<int, int>
#define f first
#define mp make_pair
#define s second

Java

import java.io.*;
import java.util.*;
public class ArrayDesc {
public static final int MOD = (int)1e9 + 7;
public static void main(String args[]) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(r.readLine());
int N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());

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!