exec_outcome stringclasses 1
value | code_uid stringlengths 32 32 | file_name stringclasses 111
values | prob_desc_created_at stringlengths 10 10 | prob_desc_description stringlengths 63 3.8k | prob_desc_memory_limit stringclasses 18
values | source_code stringlengths 117 65.5k | lang_cluster stringclasses 1
value | prob_desc_sample_inputs stringlengths 2 802 | prob_desc_time_limit stringclasses 27
values | prob_desc_sample_outputs stringlengths 2 796 | prob_desc_notes stringlengths 4 3k ⌀ | lang stringclasses 5
values | prob_desc_input_from stringclasses 3
values | tags listlengths 0 11 | src_uid stringlengths 32 32 | prob_desc_input_spec stringlengths 28 2.37k ⌀ | difficulty int64 -1 3.5k ⌀ | prob_desc_output_spec stringlengths 17 1.47k ⌀ | prob_desc_output_to stringclasses 3
values | hidden_unit_tests stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PASSED | 25af8414a3828639d73f7c4b5856c22d | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
public class ChipMove_1716D {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), k = sc.nextInt(), mod = 998244353;
sc.close();
int[] dp = new int[n + 1];
int[] total = new int[n + 1];
dp[... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 70f1b6b4e864489b9ae320503f7f76c5 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
public class CF1{
public static void main(String[] args) {
FastScanner sc=new FastScanner();
// hamare saath shree raghunath to kis baat ki chinta...... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 248bb210f3811a95dae6f21705026878 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.util.concurrent.TimeUnit;
import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class D1716D{
public static void solve(){
}
public static void main(String args[])throws IOException, Pa... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 0df890e5cbbebd41edf3f67834b1e4f2 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.util.concurrent.TimeUnit;
import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class D1716D{
public static void solve(){
}
public static void main(String args[])throws IOException, Pa... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 7f4b92ae2a54b4ad8a34997c8df3142a | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.util.concurrent.TimeUnit;
import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class D1716D{
public static void solve(){
}
public static void main(String args[])throws IOException, Pa... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 4fd4e7b5d59277328a7a32a11aec4216 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
int mod=998244353;
int n=cin.nextInt(),k=cin.nextInt();
int dp[]=new int[n+1];
int ans[]=new int[n+1];
int step=k;
dp[0]=1;
for(int i=k;i<=n;step++,i+=ste... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | b667e93cbd057f1a38865352d8b722f6 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes |
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class dd {
static int mod = 998244353;
static Read s = new Read();
static int n;
public static void main(String[] args) throws IOException {
int n = s.nextInt();
int k = s.nextInt();
int[]... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 8 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 03607331d715f15ccfda126f2f5625ae | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.io.*;
public class D {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader(){
br = new BufferedReader(
new InputStreamReader(System.in));
}
String next(){
while (st == null || !st.hasMoreElements()){
try{
st ... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 6580b1a6cd4ff401b78481a204db8ed4 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
public class ChipMove {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] input = br.readLine().... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 7cbfab384b89a89094c50883c7b82825 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.util.function.*;
import java.io.*;
// you can compare with output.txt and expected out
public class RoundEdu133D {
MyPrintWriter out;
MyScanner in;
// final static long FIXED_RANDOM;
// static {
// FIXED_RANDOM = System.currentTimeMillis();
// }
final static String I... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 1058a7919f528112081162b8c1591214 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class ChipMove {
private static final int MOD = 998244353;
public static void solve(FastIO io) {
final int N = io.nextInt();
final int K = io.nextInt();
int[] ans = new int[N + 1];
int[] ways = new int[N + 1];
int[] next = new int[N + 1];
way... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | bad8599cfad56a813c8ca9e635bb5869 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class D {
Input in;
PrintWriter out;
public D() {
in = new Input(System.in);
out = new PrintWriter(System.out);
}
public static void main(String[] args) {
D solution = new D();
solution.solve();
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 0cbbbb3229f1d4261b0dd9f0f4bac18f | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class D {
Input in;
PrintWriter out;
public D() {
in = new Input(System.in);
out = new PrintWriter(System.out);
}
public static void main(String[] args) {
D solution = new D();
solution.solve();
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | e9b4b9b5620ecfda687d6f9e943a946e | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class CF1716D extends PrintWriter {
CF1716D() { super(System.out, true); }
Scanner sc = new Scanner(System.in);
public static void main(String[] $) {
CF1716D o = new CF1716D(); o.main(); o.flush();
}
static final int MD = 998244353;
void main() {
int n = sc.nextI... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 17 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | b4944967374d628774df79d5afe514d5 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | // package c1716;
//
// Educational Codeforces Round 133 (Rated for Div. 2) 2022-08-04 07:35
// D. Chip Move
// https://codeforces.com/contest/1716/problem/D
// time limit per test 2 seconds; memory limit per test 256 megabytes
// public class Pseudo for 'Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | ba442e47a004ac85d79ef249f6789040 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | // package c1716;
//
// Educational Codeforces Round 133 (Rated for Div. 2) 2022-08-04 07:35
// D. Chip Move
// https://codeforces.com/contest/1716/problem/D
// time limit per test 2 seconds; memory limit per test 256 megabytes
// public class Pseudo for 'Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 12938dee843b02a652353a339042bce0 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;
import static java.lang.System.out;
public class Main2 {
public static void main(String[] args)throws IOException{
var solver = new Main2();
solver.solve();
}
final int MOD = 998244353;
int add(l... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | ccc683b013752d1c87ea775a0e814b64 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.io.*;
public class D {
static class Scan {
private byte[] buf=new byte[1024];
private int index;
private InputStream in;
private int total;
public Scan()
{
in=System.in;
}
public int scan()throws ... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | e762c5700a8cbd73fe31d914598e9d26 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class D {
static int mod=998244353;
public static void main(String[] args) throws IOException {
Scanner stdin=new Scanner(System.in);
int n=stdin.nextInt();
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 0dfab78ff133976a642ca0909fb413bc | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | // Problem: D. Chip Move
// Contest: Codeforces - Educational Codeforces Round 133 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1716/problem/D
// Memory Limit: 256 MB
// Time Limit: 2000 ms
import java.io.*;
import java.util.*;
public class Main {
static IntReader in;
static FastWriter... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | ae029467f433dc5367e4283fe88716cc | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | // Problem: D. Chip Move
// Contest: Codeforces - Educational Codeforces Round 133 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1716/problem/D
// Memory Limit: 256 MB
// Time Limit: 2000 ms
import java.io.*;
import java.util.*;
public class Main {
static IntReader in;
static FastWriter... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 30f43bce66a330546f1d94339af64795 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.Thread.State;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 9be5dac4e7dee435660c8b86e38bbca0 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.Thread.State;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | a43c004b333d5e7988fa5288ace8dc1a | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.awt.SystemColor;
import java.io.*;
import java.util.*;
//import org.graalvm.compiler.core.common.Fields.ObjectTransformer;
import java.math.*;
import java.math.BigInteger;
public final class A
{
static PrintWriter out = new PrintWriter(System.out);
static StringBuilder ans=new String... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | f5606b3a0cd720f5f71f7ec82a6fbc09 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class Solution extends PrintWriter {
long MOD = 998_244_353L;
void solve() {
int n = sc.nextInt();
int k = sc.nextInt();
long[] dp = new long[n+1];
long[] dq = new long[n+1];
long[] ans = new long[n+1];
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 766eb592a0bedbf3842bcde3813f2f99 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
static ContestScanner sc = new ContestScanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
static StringBuilder sb = new StringBuilder();
static int mod = 998244353;
public static void main(String[] args) throws... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 9915bf82c948777b5871918167998f62 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import j... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 2fa84ae20a7074aa2e01271aaf32bf0b | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class ChipMove {
private static final int MOD = 998244353;
public static void solve(FastIO io) {
final int N = io.nextInt();
final int K = io.nextInt();
int[] ans = new int[N + 1];
int[] ways = new int[N + 1];
int[] next = new int[N + 1];
way... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 4b1b4c3706366deebcc73f760d0f8dd6 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class D {
static int MOD = 998244353;
static int MCNT = 633;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(new BufferedWriter(new O... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 21ef8e06c10644c0f2c940254e871c57 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static Scanner sc;
static PrintWriter out;
public static void main(String[] args) {
sc = new Scanner(System.in);
out = new PrintWriter(System.out);
int t = 1;
if (false) {
t = sc.nextInt();
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | e33590df7912e5f89a9c4d5fbd503072 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 3f22d386f789f42823c69d4ace51b1b2 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
//BufferedReader f = new BufferedReader(new FileReader("uva.in"));
//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("threesum.out")));
BufferedRe... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 5914f0382bf6c7e39982a86b71027a76 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class D {
static final int INF = 998244353;
public static void main(String[] args) throws IOException {
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringToke... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | b5bf5ae6ba09d6f9c5e3baa8f69395a6 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class testing {
public static void main(String[] args) throws IOException {
FastScanner input = new FastScanner(false);
int t = 1;//input.nextInt();
PrintWriter out = new PrintWriter(System.out);
for (int iter = 0; iter<t; iter+... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | a713c10f8626e5e03ad5d2491289d7a0 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author SAMUEL
*/
public class Main {
public static void main(String[] args) {
FastReader sc=new FastReader();
int n1=sc.nextInt();
... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 8fe8b109420145a4191ffa1fd56799df | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
public class CF1{
public static void main(String[] args) {
FastScanner sc=new FastScanner();
// hamare saath shree raghunath to kis baat ki chinta...... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 1bf6302ca7f5620c8503c58651b676e9 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.text.DecimalFormat;
import java.util.*;
public class UWI {
//#0.00代表保留两位小数
static DecimalFormat df = new DecimalFormat("#0.00000000");
void solve() {
for (int T = 1; T > 0; T--) go();
}
void go() {
int MOD = 998244353;
int n = ... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 1dff844c5db0553ea2a6c94256c90fbd | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.util.*;
import java.io.*;
public class D {
static class Scan {
private byte[] buf=new byte[1024];
private int index;
private InputStream in;
private int total;
public Scan()
{
in=System.in;
}
public int scan()throws ... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 752bb35dd3bc4bb9565c06403dec0e46 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | /*
"Everything in the universe is balanced. Every disappointment
you face in life will be balanced by something good for you!
Keep going, never give up."
Just have Patience + 1...
*/
import java.util.*;
import java.lang... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | 863276c27fb0fe0a088096d3fd376563 | train_109.jsonl | 1659623700 | There is a chip on the coordinate line. Initially, the chip is located at the point $$$0$$$. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by $$$k$$$, the le... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static int mod = 998244353;
//static int mod = (int)1e9+7;
static boolean[] prime = new boolean[1];
static int[][] dir1 = new int[][]{{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
static int[][] dir2 = new int[][]{{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -... | Java | ["8 1", "10 2"] | 2 seconds | ["1 1 2 2 3 4 5 6", "0 1 0 1 1 1 1 2 2 2"] | NoteLet's look at the first example:Ways to reach the point $$$1$$$: $$$[0, 1]$$$;Ways to reach the point $$$2$$$: $$$[0, 2]$$$;Ways to reach the point $$$3$$$: $$$[0, 1, 3]$$$, $$$[0, 3]$$$;Ways to reach the point $$$4$$$: $$$[0, 2, 4]$$$, $$$[0, 4]$$$;Ways to reach the point $$$5$$$: $$$[0, 1, 5]$$$, $$$[0, 3, 5]$$$,... | Java 11 | standard input | [
"brute force",
"dp",
"math"
] | c5f137635a6c0d1c96b83de049e7414a | The first (and only) line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$). | 2,000 | Print $$$n$$$ integers — the number of ways to reach the point $$$x$$$, starting from $$$0$$$, for every $$$x \in [1, n]$$$, taken modulo $$$998244353$$$. | standard output | |
PASSED | ea6f5728babf6c0c10c9db4c14790ddf | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class randomfa {
public static void main (String []args){
Scanner sc = new Scanner (System.in);
int a = sc.nextInt();
long []ar = new long[a+1];
int cou=0;
while (a>0){
long b = sc.nextInt();
if(b==1){ar[cou] = 2;
cou++;}
else if (b==2|... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 897abcf0d6406d444b6df6fae074f6e7 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.util.*;
import java.text.*;
public class MyClass {
public static void main(String args[]) throws Exception {
Scanner sc = new Scanner(System.in);
int inputCount = sc.nextInt();
int ans = 0;
while(inputCount > 0){
ans = 0;
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 9006ee31c3bcc6e0a1ca271abb001719 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt(), num;
for (int i = 0; i < t; i++)
System.out.println((num = sc.nextInt()) / 3 + (num != 1 ? Math.min(1, num % 3) : 2));
}
} | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 052ae2d65f26e0a9a12477ff4e8a13e8 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Sol {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
// int ar[] = new int[n];
int n =sc.nextInt();
while(n-->0){
int x = sc.nextInt();
sol(x);
}
}
public static void sol(int ... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | ff7f171db73f4f6ec1ab10dbd7685441 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Sol {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
// int ar[] = new int[n];
int n =sc.nextInt();
while(n-->0){
int x = sc.nextInt();
sol(x);
}
}
public static void sol(int x){
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | cca5490adfb63c9026730d1c33412b02 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Sol {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
// int ar[] = new int[n];
int n =sc.nextInt();
while(n-->0){
int x = sc.nextInt();
if(x%3 == 0){
System.out.println(x/3);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | acfa74dac92590fd24611ba49f857c80 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.IOException;
import java.util.*;
public class Certifications {
public static void main(String[] args) throws IOException {
Scanner c = new Scanner(System.in);
int test = c.nextInt(), i = 1, cont = 0;
while (i <= test) {
int number = c.nextInt();
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | b11fb4ffc29ce1a61ab45707a53a6a6a | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | // package com.algorithms;
import java.util.*;
public class Pset18 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int isN = n == 1 ? 1 : 0;
int result = (n <= 3) ? (1 + isN) : (int) Math.floor((n+... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 3e3bd6bf62c7f834f55b9d4d457b2ae0 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class A_2_3_Moves {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- != 0) {
int n = sc.nextInt();
if (n == 1) {
System.out.println(2);
continue;
}
int ans1 = n / 2;
int ans2 = n / ... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 04de326795200eccd8c6915631b58c70 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class A_2_3_Moves {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- != 0) {
int n = sc.nextInt();
if (n == 1) {
System.out.println(2);
continue;
}
int ans1 = n / 2;
if (n % 2 == 1)... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 71884a9b02d13bb6208eaa5d0e9e54e8 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Moves {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
int[] dest = new int[t];
int[] temp = new int[t];
int sum = 0;
for(int i=0;i<t;i++) {
dest[i]=sc.nextInt()... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | af0aa32e729436414259dd23c7305c0e | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
import java.lang.*;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t>0){
int n = sc.nextInt();
if(n==1)
System.out.println(2);
else if(n%3=... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 285a601e86a4768171e4070696589ed0 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
import static java.lang.Math.max;
import static java.lang.Math.min;
public class A {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while (t-->0) {
int n = scanner.nextInt();
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 75ce50140bd5ac5222df6f0bd1cdb553 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class New{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i=0;i<t;i++){
int n = sc.nextInt();
if(n==1){
System.out.println("2");
}
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 840c634d9cca05c0ede9416c2892c278 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class cls{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
if(n==1){
System.out.println("2");
}
else{
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | acffa2f69d2dfcfc20cad411ea39f7c1 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class moves2_3 {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
System.out.println(steps(n));
}
}
static int steps(int... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | c6ec6b361ef58d92ba06a12facfa3203 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class moves23 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in) ;
int t = in.nextInt();
for (int i = 0; i < t; i++){
int n = in.nextInt() ;
if ( n == 1 ) {
System.out.println("2");
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 371ed6dfa004d6efdee023d0bd79456d | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
private static int k=0;
public static void main(String[] args) throws IOException {
BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
FastReader fastReader = new FastReader();
int test_cases = fastRe... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 89d8b51c52dda2afb307f63054e5a7be | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Math;
public class Solutions{
public static void main(String args[]) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t= Integer.parseInt(br.readLine());
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 0117f0ce09d82814c5e70ed10c466e05 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class ACMP {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
ArrayList<Integer> ans = new ArrayList<>();
while (t-- > 0) {
int n = sc.nextInt();
if(n==1) {
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | aba084efcff91405b7e1ca4bd6560de9 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
public class Main{
static class InputReader {
/**
* The default size of the InputReader's buffer is 2<sup>16</sup>.
*/
private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
/**
* The default s... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | e927055b946043cfaa856dcc1c329c40 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
var in = new Scanner(System.in);
var tests = in.nextInt();
while (tests-->0){
var n = Math.abs(in.nextInt());
var count = 0;
if(n%3==0) count = n/3;
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | ce58c7aef825d68d716f4bf814df640f | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class problemA{
public static void main(String[] args) {
Scanner sh = new Scanner(System.in);
int t = sh.nextInt();
while(t>0){
int n = sh.nextInt();
int min = 1000000001;
if(n%3 == 0){
min = Math.min(min, n/3);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 9edf46a7615d7d8e1f8060028c9668b1 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
import java.io.*;
public class Solution {
// DO NOT MODIFY THE LIST. IT IS READ ONLY
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | b605a480a7b3461c7a34cece37719da5 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.util.*;
public class Moves{
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
int test = sc.nextInt();
int arr[] = new int[test];
for(int... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 65cca8658fc525abd5ce7bf37d7a9d5e | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int t = input.nextInt();
while (t > 0) {
t--;
int result = solve(input.nextInt());
System.out.println(result);
}
input.close();
}
private ... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | b85835a09e3dc974527bf07c516ec47a | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.lang.*;
import java.lang.Exception;
import java.math.BigInteger;
import java.util.*;
public class Main {
private static final BufferedWriter sout = new BufferedWriter(new OutputStreamWriter(System.out));
private static final double PI = 3.141592653;
public static int ... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 3ce54dc7656acd752ee27610216828d9 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes |
import java.util.Scanner;
public class Moves {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int testCase = input.nextInt();
int num = 0;
int result = 0;
while(testCase-- > 0){
num = Math.abs(input.nextInt())... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | dafd30d2544eb50840d84b81124fe576 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
int num = scanner.nextInt();
while(num-- > 0){
test_case();
}
}
private static void test_case() {
int n = sc... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | b3d3876d9417d3b508de45a7f0c0f83b | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes |
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 11d806b8b6ea25f9ccf159ed32f04599 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class solution{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0){
int n = sc.nextInt();
if (n == 1){
System.out.println(2);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 948eb88f85cd84c53d70de4ecb528e46 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Solution {
public static long findSteps(long n) {
if(n == 0)
return 0;
if(n == 1)
return 2;
return (n % 3 == 0 ? n / 3 : n / 3 + 1);
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
while(t > 0) {
long n = ... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 084c4f21fc736a59ab0bd3e22f1aabab | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int count = scanner.nextInt();
for (int i = 0; i < count; i++) {
System.out.println(solution(scanner.nextInt()));
}
}
public static i... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | ead15ec4a88e5799953465bb1601ca3a | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | /*--------
Author : Ryan Ranaut
__Hope is a big word, never lose it__
----------*/
import java.io.*;
import java.util.*;
public class Codechef1 {
static PrintWriter out = new PrintWriter(System.out);
static final int mod = 1_000_000_007;
static final long max = (int) (1e18);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | e82016c3f8befd969dd664ceb0b15ccc | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Main{
static int Minimum(int a, int b){
if(a<b) return a;
return b;
}
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
while(t>0){
t-=1;
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 85aac78994032d4fe155c602b1e272b5 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class MyClass {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t;
t=sc.nextInt();
int num;
int temp;
for(int i=0; i<t; i++){
num=sc.nextInt();
if(num==1){
System.out.println(2);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 2d3108d425e011c958359575e0b0c63f | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class main {
public static void main(String args[] ) throws Exception {
Scanner in=new Scanner(System.in);
for(int t=in.nextInt();t>0;t--){
int n=in.nextInt();
if(n==1)System.out.println(2);
else System.out.println((n+2)/3);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | a5eb7390946e857ce5aa2675a6fd52e2 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class main {
public static void main(String args[] ) throws Exception {
Scanner in=new Scanner(System.in);
for(int t=in.nextInt();t>0;t--){
int n=in.nextInt();
if(n==1)System.out.println(2);
else System.out.println((int)Math.ceil(... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 8091f728eb9ff907fb304874715952b7 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.util.*;
public class Solution {
public static void solve() throws Exception{
//read for each testcase line b line ysing bf reader
st = new StringTokenizer(bf.readLine());
int n = Integer.parseInt(st.nextToken());
int rem = n%3;
int ans = ... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 52aa5e8e63a3bad779c05825413a5707 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Main{
public static void main(String [] args){
Scanner sc= new Scanner(System.in);
int t= sc.nextInt();
while(t-->0){
int n= sc.nextInt();
int count=0;
//int t= sc.nextInt();
int s=0;
if(n... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 0396049fbaf28d525a42c9fbed8db639 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i = 0 ; i < t ; i++) {
int x = sc.nextInt();
if(x == 1){
System.out.pri... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 78b5337be2eff40efbf766f9a4211f04 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Timepass {
public static int calc(int x) {
int k=x/6;
if (x == 1) {
return 2;
}
if(x%6==0){
return 2*k;
}
else if(x%6<=2){
return (2*(k-1))+3;
}
else if(x%6==3){
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | c33d30c07873b5ba1f6f0810485bbb2e | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class ProblemA {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt(); // Number of test cases.
while(t > 0){
long n = sc.nextInt(); // Number of inputs.
if(n == 1){
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | ac68b54e642b6ea564ce4d9c28254117 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Solution {
public static void main(String k[]) {
Scanner sc = new Scanner(System.in);
int tc = sc.nextInt();
while (tc-- > 0) {
long r = sc.nextLong();
if (r % 3 == 0)
System.out.println(r / 3);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | d218e95b651cc912f8d59139119db8bf | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.PriorityQueue;
import java.util.Scanner;
public class oooo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int i=0;
i=n/3;
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | c151d94e6f04e23dbe753bc02ec73293 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while (t > 0) {
t--;
int n = scanner.nextInt();
if (n == 1) {
Syste... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 829c4b825efb50e2f4c631123b9ba87f | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class P1 {
static class FastReader {
BufferedReader br;
StringTokenizer st;
String next()
{
while (st == null || !st.hasMoreElements()) {
try {
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 4c383e93fabc26914f1c975dd85ca44c | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.math.BigInteger;
import java.util.*;
public class P1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t>0) {
int n = sc.nextInt();
if(n == 1)System.out.println(2);
else if(n == 4)System.out.println(2);
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 4ceef5b55bec667cbd447b825a116a04 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Codechef {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static PrintWriter pw = new PrintWriter(System.out);
private static Scan... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 77d0cd296513a1d15e1acd63d99473c4 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int t = input.nextInt();
for (int i = 0 ; i < t; i++)
{
int n = input.nextInt();
if (n==1)
System.out.pr... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 5f96cf7344520ad5d70529899546b42d | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes |
// import java.lang.reflect.Array
import java.util.*;
public class Solution {
static int n, p;
public static int average(int p) {
int t = 0;
if (p == 1) {
t = 2;
} else if (p == 2) {
t = 1;
} else if (p % 3 == 1 || p % 3 == 2) {
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 53d3376df039e27cc1c42e9d0a3b67ef | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
for(int i = 0; i < n; i++)
{
int num = scan.nextInt();
int rem = num/3;
if(num == 1) System.out.println(2);
else if(num%3 > 0) System.o... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | f7587497cded6b1d142e10c82705975b | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class A1716 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while(t>0){
int n = scanner.nextInt();
int minMinutes = getMinMinutes(n);
System.out.prin... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 302fc2b86b33e3517d123343fbc629ba | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Moves {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
if(n==1)
System.out.println("2");
else if(n%3==1)
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | e0c1dbeef9d512a57c36654043a90f2d | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Main
{
static int dp[];
static int fun(int n){
if(n==0)return 0;
if(n<0) return 1;
if(dp[n]!=(-1)) return dp[n];
return dp[n]=Math.min(fun(n-3)+1,fun(n-2)+1);
}
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | d2fc4021ac23f1d593bbb45ba2ab660c | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.Scanner;
public class Codeforces {
public static void main(String[] args) {
Scanner lta = new Scanner(System.in);
int t = lta.nextInt();
while (t -->0){
int n = lta.nextInt();
int min = 0;
if (n < 2){
System.out.... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 2aff27084f640b2adbdf318e868df47f | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
import java.io.*;
public class Solution {
private static final SuperFastReader sc = new SuperFastReader();
private static final int MOD = (int) (1e9) + 7;// ((a + b) % MOD + MOD) % MOD
public static void main(String[] args) throws IOException {
int t = sc.Int();
for (in... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | 585688fcc9028b126f65f98f6ff39cfc | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
import java.io.*;
public class Solution {
private static final FastReader sc = new FastReader();
private static final int MOD = (int) (1e9) + 7;// ((a + b) % MOD + MOD) % MOD
public static void main(String[] args) throws IOException {
int t = sc.Int();
for (int i = 1; i... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | f44fd360e4ee669ad0112ccbf8068fae | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.io.*;
import java.util.*;
public class FastI_O {
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
br=new BufferedReader(new InputStreamReader(System.in));
}
String next(){
while(st==null || !st.has... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output | |
PASSED | fbbdbe57f6de4e18a75caebbe2b6bcf7 | train_109.jsonl | 1659623700 | You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c... | 256 megabytes | import java.util.*;
public class Contest_1 {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int []arr=new int[n];
int []count=new int[n];
for(int i=0;i<n;i++){
count[i]=0;
arr[i]=s.nextInt();
... | Java | ["4\n\n1\n\n3\n\n4\n\n12"] | 1 second | ["2\n1\n2\n4"] | null | Java 17 | standard input | [
"greedy",
"math"
] | 208e285502bed3015b30ef10a351fd6d | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case. | 800 | For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.