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
3d7d88e5ff3cc0c84e5102628a7e8a66
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Solution{ static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] YDSV) throws IOException{ StringTokenize...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
5073141d292098751d4327cfb4158bc4
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
//package codeforces; import java.util.*; public class B123edu { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int t = 1; t = scn.nextInt(); while (t-- > 0) { int n = scn.nextInt(); int[] arr = new int[n]; for (int i = n - 1; i >= 0; i--) { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
0394ab96e1dfd0c121c23a79ead79fac
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
// import java.io.*; // import java.util.*; // public class Main{ // static class FastReader { // BufferedReader br; // StringTokenizer st; // public FastReader() // { // br = new BufferedReader( // ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
2401ce36892d3eeec0525587c644a9c9
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
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 fb[] = new int[n]; for(int i=0;i<n;i++){ fb[i] ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
427399837cf05328af2a4223faee92b7
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.*; import java.util.stream.IntStream; import java.util.stream.Stream; public class Main { public static void main(String[] args) { in = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); try { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
2fb8fc32bd0909626405628c3fc27242
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.*; import java.util.stream.IntStream; import java.util.stream.Stream; public class Main { public static void main(String[] args) { in = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); try { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
c8b4a83dcc36a1305d5651f662d0e5c1
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class cf1644B { public static void main(String[] args) { FastReader sc = new FastReader(); StringBuilder sb = new StringBuilder(); int t = sc.nextInt(); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
4ebe94830908975b6240782af3c4b0a5
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class cf1644B { public static void main(String[] args) { FastReader sc = new FastReader(); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt();...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
ae891ff5776aa2ca8aad2afe8cf15a07
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; import java.util.Collections; import java.util.ArrayList; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(St...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a179d2022079b01a2635633db647cb94
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; import java.io.PrintWriter; public class antiFib{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt()...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
80fc46f56d01e9aade48d84979db63b1
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.LinkedList; import java.util.Scanner; import java.io.PrintWriter; public class antiFib{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while(t-->0){ ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
424ed0e3513a49f2f8f1fd574e6eb24f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.lang.Math; import java.util.Scanner; import java.util.Arrays; import java.util.Collections; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.ArrayList; public class codeforces { public static void main(String[] args) { Scanner sc =...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
e5a55b154558c817422e902a3a88551e
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*;import java.util.*; public class Main { static FastReader fr=new FastReader(); static int[] maxSubArraySum(int a[], int size) { int max_so_far = a[0]; int curr_max = a[0]; int dp[]=new int[size]; dp[0]=a[0]; for (int i = 1; i < size; i++) { curr_m...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
3e445041751b5e5d22eeadf822160844
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*;import java.util.*; public class Main { static FastReader fr=new FastReader(); public static void main(String[] args) throws IOException { int tt=1; tt=fr.ni(); while(tt-->0) { int n=fr.ni(); List<Integer> al=new ArrayList<>(); for(int i=1;i<=n;i++) { al.a...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
c3964be75c4769c3810ea2a7ef153ef3
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
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.*; impor...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
dcc3158c2d53de2a5d3cdf3bc8977a97
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
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.*; impor...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
55fe3c632c50fd2e0705e897b69e0dff
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
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.*; impor...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
4657fd91fb4b4d8861045a9013640aad
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; public class Code_Forces { static final int INT_MAX = Integer.MAX_VALUE; static FastReader in = new FastReader(); static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws java.lang.Exception { int TestCases = ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a822ecc14d1d4bf65bd63f84212311ab
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Code_Forces { static final int INT_MAX = Integer.MAX_VALUE; public static void main(String[] args) throws java.lang.Exception { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
f3c31d6cbe3ff1b300c2cea651e269f3
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class codeforces{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n =sc.nextInt(); int x =0; ArrayList<Integer> arr = new Arr...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
c6c1aa2b9e3bef3ecded0ccdb960aee5
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.util.Map.Entry; public class practice { public static void helper(int n){ int[] arr=new int[n+1]; int f=n; for(int i=1;i<=n;i++)arr[i]=f--; print(arr,1,n); System.out.println(); int idx=n; for(int i=2;i<=n;i...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
954506c1d7fab38c7c61da03cd51217e
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; 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(); for(int i=n;i>=1;i--) System.out.print(i+" "); System.out.println...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
462597c312306e0d2aa9e95e7e2f73cf
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; public class antifibonacci{ public static void main(String[] args){ Scanner xed=new Scanner(System.in); int t=xed.nextInt(); for(int j=0;j<t;j++) { int n=xed.nextInt(); int[] a=new int[n]; for(int i=0;i<a.length;i++) { a[i]=i+1; } for(int i=0;i<a.length/2;i++) ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
ebbc8b1bf27356313b51006ad62e5636
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { Scanner sc=new Scanner(Sys...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a483ded6c378cdf4560aabe535a1ea93
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; public class B { public static void main(String[] args) { Scanner go = new Scanner(System.in); int t = go.nextInt(); while (t-->0){ int n = go.nextInt(); int[] a = new int[n]; int[] b = new int[n+1]; if (n =...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
84c3c5faa60e4d506e31671ed570492b
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
// package template; import java.util.*; //import pepCodingGraph.GetComponentVisited.Edge; import java.io.*; public class Template { public static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); String...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
9a7526756671535b137625e69351d908
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; public class Solution{ public static void main(String[] args) throws Exception{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine()); while(t-->0){ int n=Integer.parseInt(br.re...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
3127077590bc7ea78daf3d2106fd5d5d
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class Codeforces { public static void main(String[] args) { try { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); if(n==3){ Syste...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b454a76a17b4540236d6d2aeb1aead8b
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Main { 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
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
9465f1b029b800f7330d48564327d462
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef {static class FastReader { BufferedReader br; StringTokenizer st; pub...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
73b5b32763cb6399f960c76ebee0524f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.*; import static java.lang.System.out ; public class CP0125 { public static void main(String args[])throws Exception{ PrintWriter pw = new PrintWriter(out); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b656e2cbc83320cfcb1e327f47ce067b
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.stream.IntStream; public class B_AntiFib { public static void main(String[] args) throws IOException { BufferedScanner input = new BufferedScanner(); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b9065cc7550c466ad7a77c4e3e0dd114
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
/*input 4 4 3 5 6 */ import java.util.*; import java.lang.*; import java.io.*; public class Main { static PrintWriter out; static int MOD = 1000000007; static FastReader scan; /*-------- I/O usaing short named function ---------*/ public static String ns(){return scan.next();} ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a65afd098c9020885652efa0fe5a7210
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Print...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
d6de4194ceedeb3062a1be16e5b12493
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b8b7340843a49072a5746c219feeab62
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Practice { static boolean multipleTC = true; final static int mod = 1000000007; final static int mod2 = 998244353; final double E = 2.7182818284590452354; final double PI = 3.14159265358979323846; int MAX = 10000005; void pre() throws Exception { } // All ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
8a99726d3c9e0111e0e430f4689253c6
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class Main { public static void main(String[] code_7) { Scanner scanner = new Scanner(System.in); StringBuilder str = new StringBuilder(); int t = scanner.nextInt(); while (t-- > 0) { int n = scanner.nextInt(); if (n == 3) ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
20a5d83f1367454801570b7de7e5b8ce
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Solution { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); BufferedWriter output = new Buffere...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
610e040d619454f8cd7e4adf3508082e
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Deque; import java.util.LinkedList; public class B { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()....
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
314fc408d6f8e863b6ceea5845e702b6
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; import java.math.BigInteger; public class Main { InputStream is; PrintWriter out = new PrintWriter(System.out); ; String INPUT = ""; void run() throws Exception { is = System.in; solve(); out.flush(); o...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
5163a5663685b77641ae1c4f74bc06f4
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Random; import java.util.StringTokenizer; public class codeforces_Edu123_B { private static void solve(FastIOAdapter in, PrintWriter out) { int n = in.nextInt(); var list = new ArrayList<Integer>(); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
19d68bfac28e4673b82fd65711a16e49
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
//package com.company; import java.io.*; import java.util.*; public class Main{ static boolean[] primecheck = new boolean[1000002]; static ArrayList<Integer>[] adj; static int[] vis; static int mod = (int)1e9 + 7; public static void main(String[] args) { OutputStream outputS...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
46109bdfeec908969ef9a2b7c0abdfd9
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; // Created by @thesupremeone on 22/02/22 public class B { HashSet<String> set = new HashSet<>(); void explore(int i, int n, ArrayList<Integer> list, boolean[] used){ if(i==n){ StringBuilder builder = new StringBuilder(); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
12163499610bf0a43698155c1bcb48de
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.util.*; public class Solution { static class FastReader { BufferedReader br; StringTo...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
24177582fe45b3603d7703e80c10b2b1
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Main{ static final int MOD = (int) 1e9 + 7; public static void main (String[] args){ FastReader s = new FastReader(); int t=1;t=s.ni(); for(int test=1;test<=t;test++){ int n=s.ni();long ans=0,sum=...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a033fb2650dd610b9ae2ad8f9e59dd08
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; public class CF2908{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int testCases = scan.nextInt(); while(testCases>0){ int number = scan.nextInt(); if(number==3){ System.out.println("3 2 1"); System.out.println("1 3 2"); Syst...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
cef62381de76d6614aeb8ba5e0cebbc5
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
//<———My cp———— //https://takeuforward.org/interview-experience/strivers-cp-sheet/?utm_source=youtube&utm_medium=striver&utm_campaign=yt_video import java.util.*; import java.io.*; public class Solution{ static PrintWriter pw = new PrintWriter(System.out); public static void main(String[] args) throws...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
2ff773faf906b139b2f380e8ff03455c
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class AntiFibo { public static void dfs(boolean [] visit, int k, List<Integer> ans, int [] n) { if(ans.size() == k && n[0] > 0) { for(int i : ans) { System.out.print(i + " "); } System.out.println(); n[0]--; return; } for(int ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b305dfdcb084a675d5df36aaedf1b287
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class AntiFibo { public static void dfs(boolean [] visit, int k, List<Integer> ans, int [] n) { if(ans.size() == k && n[0] > 0) { for(int i : ans) { System.out.print(i + " "); } System.out.println(); n[0]--; return; } for(int i...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
25de2720c85d78000a2eca8f172913bd
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; public class Q1644B { static int mod = (int) (1e9 + 7); static void solve() { int n = i(); ArrayList<ArrayList<Integer>>al=helper(n); for(int i=0;i<al.size();i++){ ArrayList<Integer>sm=al.get(i); for(int val:sm){ ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b8704520aba1f7ec97aeca3506a41b69
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Random; import java.util.StringTokenizer; public class I2 { private static class FastReader { BufferedReader br; StringTokenizer st; public ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
1dbcd8f6310c5dc06af2c2b578b1c901
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.util.*; import java.io.*; import java.math.*; public class B_Anti_Fibonacci_Permutation { public static void main(String[] args) { OutputStream outputStream = System.out; ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
cc7e88e35415854c99dda9fd3319f3f7
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class go { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int x= sc.nextInt(); go: while (x-- !=0 ) { int num=sc.nextInt(); Integer[] arr= new Integer[num]; for(int i=1 ;i<=num; i++){ ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
6b01910ac25b161a053e12c6f62d4cdd
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class practice { public static void main(String[] args) { Scanner scan = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int t = scan.nextInt(); while (t --> 0) { int n = scan.nextInt(); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
1fcadce74ca1b629e1f266d681bd8ac1
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.lang.Double.parseDouble; import static java.lang.Math.PI; import static java.lang.Math.min; import static java.lang.System.arraycopy; import static java.lang.System.exit; import static java.util.Arrays.copyOf; ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
3f3a1ca7a15964d30a92eea94740ec60
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; // @author : Dinosparton public class test { static class Pair{ long x; long y; Pair(long x,long y){ this.x = x; this.y = y; } } static class Sort implements Comparator<...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
d20704ba4aa1e284324e04becc7a9d13
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; public class Codeforces { final static int mod = 1000000007; public static void main(String[] args) throws Exception { FastReader sc = new FastReader(); int t = sc.nextInt(); outer: while (t-- > 0) { // while (t-- > 0) { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
ad14f4ca8da3cd1921e790e7c93fb8c2
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Main { static StringBuilder sb; static int n; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter wr = new PrintWriter(System.out); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
5770fe75efddebc32338314116a31ceb
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Main { static StringBuilder sb; static int n; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter wr = new PrintWriter(System.out); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
f485b22da059e08c5315425e33e8764d
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; import java.util.LinkedList; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int cases = Integer.parseInt(scanner.nextLine()); while (cases > 0) { cases--; int n =...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
7dabec7dcd40b72398e6515d1b94801f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class GFG { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); int arr[]=new int[n]; int c=0; for(int i=n;i>0;i--){ ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
cf312f0063d86ee99d62fd41b29f9b66
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class AntiFibonacciPermutation { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] b...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
20cd2d58806ebf88e5d803498b294ac2
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; public class Codeforces_1644B { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out)); int t = Integer.par...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
4094d6b504044e01b24684caabeb09cf
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.IOException; import java.io.InputStreamReader; import java.io.*; import java.util.*; public class Codeforces_1644B { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseIn...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
e657bf8793b45459146e1d9affc565ae
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.math.BigInteger; import java.util.*; import java.io.*; public class _practise { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
7d347ea29028eafefc55374b874e24fb
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Solution { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == nul...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
fe7a9e9c7ba95c9b09a418d8682d93b2
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; // import javax.security.auth.kerberos.KerberosCredMessage; public class antiFib { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int t=sc.nextInt(); int n=0; while (t-->0) { n=sc.nextInt(); int[] nu...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
c5f8bcc317884e07b6237b812da95845
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
// package com.company.Cf322; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; public class AntiFibonacciPermutatioon { public static void main(String[] args) throws IOException { BufferedReader bf = new Buffe...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
90268788178e7b38688889605a0f2c2f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class a { public static void main(String args[]) { int t; Scanner sc=new Scanner(System.in); t=sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); for(int j=1;j<=n;j++) ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
19a24899243019f6a30e0c1eaf29ba7a
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.lang.*; public class Contest { static void solve(int n,List<Integer> lst) { Collections.sort(lst,Collections.reverseOrder()); int j = 0; for(int i=lst.size()-1;i>0;i--){ j = i-1; printList(lst); Collections.swap(...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
d658c5c8bd051dcea9ef8c26432ed6a9
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static class FastReader { BufferedReader br; StringTokenizer st; ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
9192fb85b4f3d0e777b4ad05c6216743
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Solution{ static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){ br=new BufferedReader(new InputStreamReader(System.in)); } String next(){ while(st==null || !st.hasMoreTo...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
43bd47315bb8d0053853122c2e45be5c
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Arrays; import java.util.Objects; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int dataCount = sc.nextInt(); StringBuilder[][] answer = new StringBuilder[dataCount][]; in...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
2f31cba9e65e012475abd887b6bd88f7
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Test { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); static StringTokenizer st; public static void print(int[] ar...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
c17369a0a0335a0069865110eaeae98f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
// import java.lang.reflect.Array; // import java.math.BigInteger; // import java.nio.channels.AcceptPendingException; // import java.nio.charset.IllegalCharsetNameException; // import java.util.Collections; // import java.util.logging.SimpleFormatter; // import java.util.regex.Matcher; // import java.util.regex...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a4dfbb4d6505bf925923ed123d0ed3bb
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; 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[] arr = new int[num]; for (int j = 0; j < arr.length; j++) { arr[j] = j + 1; } ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
8fcacbf4172cedd8a46162572cfbd547
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.io.*; public class Main{ static InputReader sc = new InputReader(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) throws IOException{ //setUp("input.txt", "output.txt"); //setUp("hps.in", "hps.out"); int T = 1; T =...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
2d923d8147065cc45826d8ac3bfc055f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { try { Reader sc = new Reader(); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
3413ff829cbc886b3d1f212d37c1f211
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; public class P10 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t = in.nextInt(); int []n= new int [t]; for(int i=0;i<t;i++) { n[i]=in.nextInt(); } for(int i=0;i<t;i++) { int [][]m=new int [n[i]][n[i]]; for(int j=0;j<n[i];j++)...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
5142d643283abd2fea6ad1fbf56209be
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class antiFib { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int t = scn.nextInt(); while(t-->0) { int n = scn.nextInt(); if(n==3) { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
dfd11ad1f5b34a7e522ea50a5d50181b
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class B { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
7f934c56e4d45f4b43f9abb5e17c7e84
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
/** * @Jai_Bajrang_Bali * @Har_Har_Mahadev */ import java.util.HashMap; import java.util.Scanner; public class practice2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n=sc.nextInt()...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
8b9113092cb3a758a365a22e553be650
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.Scanner; public class B { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for (int x = 0; x < t; x++) { int n = scanner.nextInt(); int[] p = new int[n]; for (int y = 0...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
dd731aad6e8577dc9dcfe3a4047b6f5b
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; public class B { static final Reader in = new Reader(); static final PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
48e5be8adfdc28a59b154653b738e1cf
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; // import javax.print.event.PrintJobListener; import java.io.*; public class Coding { public static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); String next () { while(!st.hasM...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
a2a8016deaee043fe2094ee889ee11d9
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
// Working program with FastReader import java.util.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class B_Anti_Fibonacci_Permutation { static class FastReader { BufferedReader br...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
196f5a4f2765390f57e2aed4aababdc1
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.util.*; public class Main { static int MAX_SIZE = (int) 1e6; static boolean []prime = new boolean[MAX_SIZE + 1]; static FastReader scn = new FastReader(); static PrintWriter out= new PrintWriter(System.out); static class Pair{ int x; int...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
1e967f333178357798e3f0895a9e4769
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.LinkedList; import java.util.Scanner; 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 n = sc.nextInt(); if(n==3){ System.out.prin...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 11
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
7f03a7b92670688d358f4ef4e42a2b28
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class AntiFibonacciPermutation{ public static void print(int k){ int l=k; for(int m=1;m<=l;m++){ for(int n=1;n<=l;n++){ if(k==0) k=l; System.out.print(k+" "); k--; } k++; System.out.println(); } } public static void main(String[] args...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 17
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
16c88a5a1d40bc139b57ea2d3bd4808f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; import static java.lang.Math.*; import static java.lang.System.*; import static java.util.Arrays.*; import static java.util.stream.IntStream.iterate; public class Te...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 17
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
b4aeecdf309a67688451f81ce4002624
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; import static java.lang.Math.*; import static java.lang.System.*; import static java.util.Arrays.*; import static java.util.stream.IntStream.iterate; public class Te...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 17
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
5783fc3e1bce5482ba9c4786613ee480
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; public class MyClass { public static void main(String args[]) { Scanner sc =new Scanner(System.in); int tc = sc.nextInt(); while(tc-- > 0){ int n = sc.nextInt(); int st = 1; while(st <= n){ System.out.print(st+" "); ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 17
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
da77039530e1d5119b149325546d008f
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.io.*; import java.text.MessageFormat; import java.util.Arrays; import java.util.InputMismatchException; import java.util.Random; /** * Provide prove of correctness before implementation. Implementation can cost a lot of time. * Anti test that prove that it's wrong. * <p> * Do not confuse i j ...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 17
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
3f5794412202c6585e8443a95c4de7bc
train_108.jsonl
1645540500
Let's call a permutation $$$p$$$ of length $$$n$$$ anti-Fibonacci if the condition $$$p_{i-2} + p_{i-1} \ne p_i$$$ holds for all $$$i$$$ ($$$3 \le i \le n$$$). Recall that the permutation is the array of length $$$n$$$ which contains each integer from $$$1$$$ to $$$n$$$ exactly once.Your task is for a given number $$$n...
256 megabytes
import java.util.*; import java.util.function.*; import java.io.*; // you can compare with output.txt and expected out public class RoundEdu123B { MyPrintWriter out; MyScanner in; // final static long FIXED_RANDOM; // static { // FIXED_RANDOM = System.currentTimeMillis(); // } final static String I...
Java
["2\n\n4\n\n3"]
2 seconds
["4 1 3 2\n1 2 4 3\n3 4 1 2\n2 4 1 3\n3 2 1\n1 3 2\n3 1 2"]
null
Java 17
standard input
[ "brute force", "constructive algorithms", "implementation" ]
85f0621e6cd7fa233cdee8269310f141
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 48$$$) — the number of test cases. The single line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$).
800
For each test case, print $$$n$$$ lines. Each line should contain an anti-Fibonacci permutation of length $$$n$$$. In each test case, you cannot print any permutation more than once. If there are multiple answers, print any of them. It can be shown that it is always possible to find $$$n$$$ different anti-Fibonacci per...
standard output
PASSED
142b7fd90265531b15450f60c848d296
train_108.jsonl
1645540500
You are given an array $$$a_1, a_2, \dots, a_n$$$, consisting of $$$n$$$ integers. You are also given an integer value $$$x$$$.Let $$$f(k)$$$ be the maximum sum of a contiguous subarray of $$$a$$$ after applying the following operation: add $$$x$$$ to the elements on exactly $$$k$$$ distinct positions. An empty subarra...
256 megabytes
import java.util.*; public class A { static class Pair { int x; int y; public Pair(int x, int y) { this.x = x; this.y = y; } } static int gcd(int n, int m) { if (m == 0) return n; else return gcd(m, n % m); } static int lcm(int n, int m) { return (n * m) / gcd(n, ...
Java
["3\n\n4 2\n\n4 1 3 2\n\n3 5\n\n-2 -7 -1\n\n10 2\n\n-6 -1 -2 4 -6 -1 -4 4 -5 -4"]
2 seconds
["10 12 14 16 18\n0 4 4 5\n4 6 6 7 7 7 7 8 8 8 8"]
NoteIn the first testcase, it doesn't matter which elements you add $$$x$$$ to. The subarray with the maximum sum will always be the entire array. If you increase $$$k$$$ elements by $$$x$$$, $$$k \cdot x$$$ will be added to the sum.In the second testcase: For $$$k = 0$$$, the empty subarray is the best option. For ...
Java 11
standard input
[ "brute force", "dp", "greedy", "implementation" ]
a5927e1883fbd5e5098a8454f6f6631f
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of testcases. The first line of the testcase contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 5000$$$; $$$0 \le x \le 10^5$$$) — the number of elements in the array and the value to add. The second line contains $$$n$$$ inte...
1,400
For each testcase, print $$$n + 1$$$ integers — the maximum value of $$$f(k)$$$ for all $$$k$$$ from $$$0$$$ to $$$n$$$ independently.
standard output
PASSED
2d7f039b2e2f7f71ffc974bd4c204589
train_108.jsonl
1645540500
You are given an array $$$a_1, a_2, \dots, a_n$$$, consisting of $$$n$$$ integers. You are also given an integer value $$$x$$$.Let $$$f(k)$$$ be the maximum sum of a contiguous subarray of $$$a$$$ after applying the following operation: add $$$x$$$ to the elements on exactly $$$k$$$ distinct positions. An empty subarra...
256 megabytes
import java.util.Scanner; public class Main { 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(); int x = in.nextInt(); int[] a = new int[n]; ...
Java
["3\n\n4 2\n\n4 1 3 2\n\n3 5\n\n-2 -7 -1\n\n10 2\n\n-6 -1 -2 4 -6 -1 -4 4 -5 -4"]
2 seconds
["10 12 14 16 18\n0 4 4 5\n4 6 6 7 7 7 7 8 8 8 8"]
NoteIn the first testcase, it doesn't matter which elements you add $$$x$$$ to. The subarray with the maximum sum will always be the entire array. If you increase $$$k$$$ elements by $$$x$$$, $$$k \cdot x$$$ will be added to the sum.In the second testcase: For $$$k = 0$$$, the empty subarray is the best option. For ...
Java 11
standard input
[ "brute force", "dp", "greedy", "implementation" ]
a5927e1883fbd5e5098a8454f6f6631f
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of testcases. The first line of the testcase contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 5000$$$; $$$0 \le x \le 10^5$$$) — the number of elements in the array and the value to add. The second line contains $$$n$$$ inte...
1,400
For each testcase, print $$$n + 1$$$ integers — the maximum value of $$$f(k)$$$ for all $$$k$$$ from $$$0$$$ to $$$n$$$ independently.
standard output
PASSED
c4d2464f7bce4f25daa38da699f264c2
train_108.jsonl
1645540500
You are given an array $$$a_1, a_2, \dots, a_n$$$, consisting of $$$n$$$ integers. You are also given an integer value $$$x$$$.Let $$$f(k)$$$ be the maximum sum of a contiguous subarray of $$$a$$$ after applying the following operation: add $$$x$$$ to the elements on exactly $$$k$$$ distinct positions. An empty subarra...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for (int f = 0; f < t; f++) { int n = in.nextInt(); int x = in.nextInt(); int[] v = new int[n + 5]; ...
Java
["3\n\n4 2\n\n4 1 3 2\n\n3 5\n\n-2 -7 -1\n\n10 2\n\n-6 -1 -2 4 -6 -1 -4 4 -5 -4"]
2 seconds
["10 12 14 16 18\n0 4 4 5\n4 6 6 7 7 7 7 8 8 8 8"]
NoteIn the first testcase, it doesn't matter which elements you add $$$x$$$ to. The subarray with the maximum sum will always be the entire array. If you increase $$$k$$$ elements by $$$x$$$, $$$k \cdot x$$$ will be added to the sum.In the second testcase: For $$$k = 0$$$, the empty subarray is the best option. For ...
Java 11
standard input
[ "brute force", "dp", "greedy", "implementation" ]
a5927e1883fbd5e5098a8454f6f6631f
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of testcases. The first line of the testcase contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 5000$$$; $$$0 \le x \le 10^5$$$) — the number of elements in the array and the value to add. The second line contains $$$n$$$ inte...
1,400
For each testcase, print $$$n + 1$$$ integers — the maximum value of $$$f(k)$$$ for all $$$k$$$ from $$$0$$$ to $$$n$$$ independently.
standard output
PASSED
6afa996b745156808a417b64e16f0d66
train_108.jsonl
1645540500
You are given an array $$$a_1, a_2, \dots, a_n$$$, consisting of $$$n$$$ integers. You are also given an integer value $$$x$$$.Let $$$f(k)$$$ be the maximum sum of a contiguous subarray of $$$a$$$ after applying the following operation: add $$$x$$$ to the elements on exactly $$$k$$$ distinct positions. An empty subarra...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main { // -- static variables --- // static FastReader sc = new FastReader(); static PrintWriter out = new PrintWriter(System.out); static int mod = (int) 1000000007; public static void main(String[] args) throws Exception { ...
Java
["3\n\n4 2\n\n4 1 3 2\n\n3 5\n\n-2 -7 -1\n\n10 2\n\n-6 -1 -2 4 -6 -1 -4 4 -5 -4"]
2 seconds
["10 12 14 16 18\n0 4 4 5\n4 6 6 7 7 7 7 8 8 8 8"]
NoteIn the first testcase, it doesn't matter which elements you add $$$x$$$ to. The subarray with the maximum sum will always be the entire array. If you increase $$$k$$$ elements by $$$x$$$, $$$k \cdot x$$$ will be added to the sum.In the second testcase: For $$$k = 0$$$, the empty subarray is the best option. For ...
Java 11
standard input
[ "brute force", "dp", "greedy", "implementation" ]
a5927e1883fbd5e5098a8454f6f6631f
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of testcases. The first line of the testcase contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 5000$$$; $$$0 \le x \le 10^5$$$) — the number of elements in the array and the value to add. The second line contains $$$n$$$ inte...
1,400
For each testcase, print $$$n + 1$$$ integers — the maximum value of $$$f(k)$$$ for all $$$k$$$ from $$$0$$$ to $$$n$$$ independently.
standard output
PASSED
7ee3e9af12b5a78bead00ac983793c44
train_108.jsonl
1645540500
You are given an array $$$a_1, a_2, \dots, a_n$$$, consisting of $$$n$$$ integers. You are also given an integer value $$$x$$$.Let $$$f(k)$$$ be the maximum sum of a contiguous subarray of $$$a$$$ after applying the following operation: add $$$x$$$ to the elements on exactly $$$k$$$ distinct positions. An empty subarra...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; // Created by @thesupremeone on 22/02/22 public class C { void solve() { int ts = getInt(); for (int t = 1; t <= ts; t++) { int n = getInt(); long x = getInt(); int[] arr = new int[n+1]; long[]...
Java
["3\n\n4 2\n\n4 1 3 2\n\n3 5\n\n-2 -7 -1\n\n10 2\n\n-6 -1 -2 4 -6 -1 -4 4 -5 -4"]
2 seconds
["10 12 14 16 18\n0 4 4 5\n4 6 6 7 7 7 7 8 8 8 8"]
NoteIn the first testcase, it doesn't matter which elements you add $$$x$$$ to. The subarray with the maximum sum will always be the entire array. If you increase $$$k$$$ elements by $$$x$$$, $$$k \cdot x$$$ will be added to the sum.In the second testcase: For $$$k = 0$$$, the empty subarray is the best option. For ...
Java 11
standard input
[ "brute force", "dp", "greedy", "implementation" ]
a5927e1883fbd5e5098a8454f6f6631f
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of testcases. The first line of the testcase contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 5000$$$; $$$0 \le x \le 10^5$$$) — the number of elements in the array and the value to add. The second line contains $$$n$$$ inte...
1,400
For each testcase, print $$$n + 1$$$ integers — the maximum value of $$$f(k)$$$ for all $$$k$$$ from $$$0$$$ to $$$n$$$ independently.
standard output
PASSED
add7615fc5697dee56a990b194bebe57
train_108.jsonl
1645540500
You are given an array $$$a_1, a_2, \dots, a_n$$$, consisting of $$$n$$$ integers. You are also given an integer value $$$x$$$.Let $$$f(k)$$$ be the maximum sum of a contiguous subarray of $$$a$$$ after applying the following operation: add $$$x$$$ to the elements on exactly $$$k$$$ distinct positions. An empty subarra...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; // Created by @thesupremeone on 22/02/22 public class C { void solve() { int ts = getInt(); for (int t = 1; t <= ts; t++) { int n = getInt(); long x = getInt(); int[] arr = new int[n+1]; long[]...
Java
["3\n\n4 2\n\n4 1 3 2\n\n3 5\n\n-2 -7 -1\n\n10 2\n\n-6 -1 -2 4 -6 -1 -4 4 -5 -4"]
2 seconds
["10 12 14 16 18\n0 4 4 5\n4 6 6 7 7 7 7 8 8 8 8"]
NoteIn the first testcase, it doesn't matter which elements you add $$$x$$$ to. The subarray with the maximum sum will always be the entire array. If you increase $$$k$$$ elements by $$$x$$$, $$$k \cdot x$$$ will be added to the sum.In the second testcase: For $$$k = 0$$$, the empty subarray is the best option. For ...
Java 11
standard input
[ "brute force", "dp", "greedy", "implementation" ]
a5927e1883fbd5e5098a8454f6f6631f
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of testcases. The first line of the testcase contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 5000$$$; $$$0 \le x \le 10^5$$$) — the number of elements in the array and the value to add. The second line contains $$$n$$$ inte...
1,400
For each testcase, print $$$n + 1$$$ integers — the maximum value of $$$f(k)$$$ for all $$$k$$$ from $$$0$$$ to $$$n$$$ independently.
standard output