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 | eebec33ce3ad41ec8207cecd87981f2b | 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 java.util.stream.*;
public class App {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
public static void main(String[] args) throws Except... | 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 8 | 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 | 3d2a8dab2ed7fb49c1d7f5adf3440b04 | 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 java.util.stream.*;
public class App {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
public static void main(String[] args) throws Except... | 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 8 | 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 | b7871f1cf5aed5977b1d0a12520c5a6c | 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 | /*
I am dead inside
Do you like NCT, sKz, BTS?
5 4 3 2 1 Moonwalk
Imma knock it down like domino
Is this what you want? Is this what you want?
Let's ttalkbocky about that :()
*/
import static java.lang.Math.*;
import java.util.*;
import java.io.*;
public class x1644B
{
public static void main(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 8 | 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 | 68a06722d13cf0127dd0cdb5c82d14b7 | 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.*;
import java.util.Arrays;
/* 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
{
Sca... | 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 8 | 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 | 1f9841df0a654008d6477614e5b0249f | 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
{
try {
Scanner sc=new Scanner... | 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 8 | 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 | 7e0cb41e188a3a3ce71cf0d6d68440bf | 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.util.StringTokenizer;
public class Submit {
public static void main(String[] args) throws IOException {
try (BufferedWriter writer... | 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 8 | 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 | 33e63988a78a0ee8c9aae045052ff2ca | 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.io.PrintWriter;
import java.util.*;
import static java.lang.System.currentTimeMillis;
/*
* @author: Hivilsm
* @createTime: 2022-04-27, 23:29:16
* @description: Platform
*/
public class Accepted... | 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 8 | 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 | f68b03e1c89842176ad2eb01b1b6a986 | 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.Math.*;
public class Inheritance{
static int highestPowerOf2(int n)
{
return (n & (~(n - 1)));
}
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int t=s.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 8 | 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 | 80f2a0e14e4dfc4cf67c0a1a367be0ab | 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.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
public class AntiFibonacciPermutation {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
List<Integer>list... | 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 8 | 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 | 3741d2b79c5c5bd834033ff6549b023f | 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.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
public class AntiFibonacciPermutation {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
List<Integer>list... | 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 8 | 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 | 3d42dd11b970a631c8b02e5f37ac39e4 | 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 code {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while (t-->0) {
int n=sc.nextInt();
int[] a=new int[n];
for (int i=0;i<n;i++){
a[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 8 | 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 | 5d6f4d13eb8f954fb24a67a3f01b503e | 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 {
private static int[] a;
private static int cnt;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
while(T-- > 0) {
cnt = 0;
int n = in.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 8 | 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 | 0cbd107124c6e1ca2c3e5b23d13aa326 | 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() {
try {
br = new BufferedReader(
new FileReader("input.txt"));
PrintStream out = new PrintStream(new FileOutputStream("output.txt"));
System.setOut(out);
} catch... | 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 8 | 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 | b1c9e340a9d9dc72580d00083ad65d0a | 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.BigInteger;
import java.util.*;
public class cpSolutions {
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next()
{
while (st == null || !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 8 | 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 | a2ec1cdb36e43fb38df7c22d93839108 | 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 int row;
static int col;
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
int j=n;
int i=0;
int p=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 8 | 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 | f7f041719aeeb78d513fc67e65991a73 | 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.Scanner;
public class exc2 {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int n= scanner.nextInt();
while(n!=0)
{
int num=scanner.nextInt();
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 8 | 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 | 682e918bc223ec2595a79b8096d3cac1 | 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 AntiFib {
public static void main(String[] args) throws IOException {
FastScanner in = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
int t = in.nextInt();
for (int i = 1; i <= t; i++) {
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 8 | 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 | 7152f25dcbfb4b0f864b656194fe76fb | 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 B {
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=1;i<=n;i++){
System.out.print(i+" ");
for(int 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 8 | 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 | 307896512a2f4f46631e64eebb216085 | 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 static java.lang.System.out;
import java.util.*;
import java.io.*;
import java.math.*;
public class Main
{
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 8 | 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 | 8b8f0129bb3472492ae7fc5b2f47bddd | 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;
public class Q222022022 {
public static void main(String[] args) throws Exception {
BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
int test=Integer.parseInt(sc.readLine());
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 8 | 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 | db50462eba466e90c4e8fe20d37b6754 | 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.*;
import java.util.*;
import java.util.function.LongToIntFunction;
public class Template {
static InputReader inputReader=new InputReader(System.in);
static BufferedReader br=new BufferedReader(new InputStreamReader(System.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 8 | 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 | e527bdbc78b58066459f448e9802d59b | 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 Main {
public static void main(String[] arg) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0) {
int n = sc.nextInt();
Integer[] arr = new Integer[n];
for(int 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 8 | 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 | 4bebdbcb853198bbefa9251d5d9d2071 | 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;
public class AntiFibonacci {
public static void main(String[] args)throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Inte... | 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 8 | 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 | f24e67ee38864bb7aa70786e602dd8be | 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 in = new Scanner (System.in);
int test;
test=in.nextInt();
while(test-- > 0)
{
int n;
n=in.nextInt();
int ar[]=new int[n];
for(int i=0;i<n;i++)
{
ar[i]=i+1;
}
int art=0,j=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 8 | 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 | bbf8de68b5d9bedf3ad40243d98b9393 | 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 java.lang.*;
import java.text.DecimalFormat;
public class quetion1template {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String 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 8 | 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 | dcdc8045e3ed9d20c0ec3e1a12ba6dc0 | 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.Scanner;
public class test1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
scan.nextLine();
for (int i = 0; i < n; i++) {
int size ... | 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 8 | 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 | c5797e2af85d240d698cfe24f4de6d7b | 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 {
static Scanner sc = new Scanner(System.in);
public static void reverse(int[] arr, int l, int r) {
int d = (r - l + 1) / 2;
for (int i = 0; i < d; i++) {
int t = arr[l + i];
arr[l + i] = arr[r - i];
arr[r - i] = t;
}
}
public 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 8 | 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 | 01790966964222476948b49ce55d17c2 | 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 {
public static class Pair implements Comparable < Pair > {
long d;
int i;
Pair(long d, int i) {
this.d = d;
this.i = i;
}
public int compareTo(Pair o) {
if (this.d > o.d)
... | 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 8 | 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 | 29000a753f2c88325960e41b94b7fc9b | 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.io.PrintWriter;
import java.util.HashMap;
public class solve {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new 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 8 | 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 | 08260ad43b99f9a216c9ca1a7b73b6fa | 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();
for(int z=0;z<t;z++){
int n=sc.nextInt();
for(int i=n;i>1;i--){
for(int j=n;j>=1;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 8 | 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 | 95f43e846b4b706552cd334262a4cae4 | 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 b {
FastScanner scn;
PrintWriter w;
PrintStream fs;
int MOD = 1000000007;
int MAX = 200005;
long mul(long x, long y) {
long res = x * y;
return (res >= MOD ? res % MOD : res);
}
long power(long x, long... | 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 8 | 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 | f2692184e328a81803efb391366fa59d | 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. util. Arrays;
public class Main {
public static void print(int[] arr)
{
for(int i=0;i<arr.length;i++)
{
System.out.print(arr[i]+" ");
}
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 8 | 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 | bffc7847f6611861160454ee29b3b0af | 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.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author ankur.y
*/
public class Ma... | 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 8 | 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 | c8ce9eed63e362fa6312c2eb944a03ba | 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 cfContest1644 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
StringBuilder sb = new StringBuilder();
k:
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 8 | 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 | 953df744c97fc8ecde4f499a9684a807 | 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 edu_123_a {
public static void main(String args[]){
FScanner in = new FScanner();
PrintWriter out = new PrintWriter(System.out);
int t = in.nextInt();
while(t-->0) {
int n=in.nextInt();
int k=0;
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 8 | 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 | d097891528c40ee333cf0229f8bc59e7 | 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 | //
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.*;
public class CFB {
... | 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 8 | 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 | 7ff0cb9b75739f88164e53179bab1cc9 | 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 |
/*
/$$$$$ /$$$$$$ /$$ /$$ /$$$$$$
|__ $$ /$$__ $$ |$$ |$$ /$$__ $$
| $$| $$ \ $$| $$|$$| $$ \ $$ ... | 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 8 | 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 | bdfaafda23d7ff579fe3e09c260ecf17 | 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.*;
/* Name of the class has to be "Main" only if the class is public. */
public class A
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scn = new Scanner(System.in);
int t=scn.nextInt();
while(t-->0) {
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 8 | 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 | 6319e800c559a3943da731e7e3812d60 | 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.management.Query;
import java.io.*;
import java.math.BigInteger;
public class Contest1 {
public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int t1=sc.nextInt();
while(t1-->0) {
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 8 | 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 | 555911d2949244539f18f5a402962fd9 | 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 jav... | 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 8 | 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 | d46e20d6aa0ba6b445c108973277af9e | 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.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
static class pair
{
long r;
long d;
public pair(long r , long d)
{
this.r= r;
this.d= d;
... | 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 8 | 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 | a2faa38db6916b32c85961e4df76395f | 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 CF.EDU123;
import java.io.*;
import java.util.*;
import java.math.*;
/**
* @Author: merickbao
* @Created_Time: 2022-02-22 21:28
* @Description: Educational Codeforces Round 123 (Rated for Div. 2)
*/
public class Main {
public static void main(String[] args) throws IOException {
InputS... | 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 8 | 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 | 174d51d5bb68bdcd07303a08d4a9b1c7 | 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.util.*;
import java.lang.*;
import java.io.*;
public class Rough_Work {
public static void main(String[] args) throws IOException {
FastReader sc = new FastReader();
PrintWriter out = new PrintWriter(System.out);
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 8 | 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 | 27ebd1ab1802d1e88926a215e5ef9c7c | 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.math.*;
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.hasMoreTok... | 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 8 | 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 | bb034053d7ee532b67d82e7246c1b9ab | 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 java.lang.*;
public class Main{
public static void swap(int i, int j, int [] arr)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] =temp;
}
public static void print(int [] arr) {
for (int i = 0; i < arr.length; i++)
System.out.print(arr[i]+" ");
S... | 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 8 | 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 | 51d354b1b1dbd66b4bf027a7a85d6d45 | 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.util.concurrent.CountDownLatch;
public class B
{
public static void main(String[] args) throws IOException
{
// int N = 100010;
// long[] a = new long[N];
in.nextToken();
int t = (int) in.nval;
while (t-- > 0)
{
in.nextToken();
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 8 | 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 | 346f390a0f0d5096cd4f185740605b40 | 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.HashMap;
import java.util.*;
public class C {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static Scanner scn = new Scanner(System.in);
public static void main(String[] args) throws Exce... | 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 8 | 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 | fb21a1507dd8763c04232f9fc79588c5 | 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 Competitve1;
//package compete;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.nio.MappedByteBuffer;
//import java.security.acl.LastOw... | 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 8 | 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 | d49ac5d8d26787b19f898d7ad3212a5f | 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 B {
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 = 0; i < N; i++) {
if (N == 3 && i == 2) {
... | 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 8 | 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 | ff6551903b6ebc57e1b4e23785291bbf | 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.stream.Collectors;
import java.io.*;
import java.math.*;
public class A_Temp4 {
public static FastScanner sc;
public static PrintWriter pw;
public static StringBuilder sb;
public static int MOD= 1000000007;
public static class FastScanner {
BufferedRea... | 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 8 | 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 | 75c804f591f08506f18aba8adffc322c | 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 java.math.BigInteger;
public class code{
public static class Pair{
int a;
int b;
Pair(int i,int j){
a=i;
b=j;
}
}
public static int GCD(int a, int b)
{
if (b == 0)
return a;
return GCD(b, a % 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 8 | 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 | fbb25cea792a1589cb8dd342feae9cb7 | 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 BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
static int N = 100010, M = N, INF = Integer.MAX_VALUE;
static int MOD = (int)1e9 + 7;
static double EPS = 1e-7;
static int dx[] = {-1, 0, 1, 0}, dy[] = ... | 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 8 | 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 | 717d05e39a8681060141e7f2fbd58861 | 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 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[] a=new int[n];
for(int i=n,j=0;i>0;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 8 | 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 | 9ed1ce7253a3a8a4439b83b1bbc11668 | 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.BigDecimal;
import java.math.*;
public class Main{
public static void main(String[] args) {
TaskA solver = new TaskA();
// boolean[]prime=seive(3*100001);
int t = in.nextInt();
for (int i = 1; i <= t ; 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 8 | 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 | c0eedc35be67ab0c75246b4a8f79eff4 | 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 m = new Scanner(System.in);
int n;
n = m.nextInt();
while(n-->0)
{
int h;
h = m.nextInt();
int arr[] = new int[h+10];
int tmp = h;
for(int i=0;i<h;++i) arr[i] =tmp--;
for(int 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 8 | 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 | 08f7d5621b64bcb0f7b75e164a299d89 | 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.Arrays;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
public class A {
publ... | 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 8 | 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 | c24f94b476d7d9fcfb09b0f9e65d1e93 | 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 B {
private static final FastScanner fs = new FastScanner();
private static final int MOD = 1000000007;
private static int cnt = 0;
public static void main(String[] args) throws IOException {
int cases = fs.nextInt();
while (cases-- > 0)
sol... | 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 8 | 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 | 5fa1754e61563319fcb3667a4ec93566 | 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 | /*
Rating: 1367
Date: 22-02-2022
Time: 20-10-02
Author: Kartik Papney
Linkedin: https://www.linkedin.com/in/kartik-papney-4951161a6/
Leetcode: https://leetcode.com/kartikpapney/
Codechef: https://www.codechef.com/users/kartikpapney
*/
import java.util.*;
import java.io.BufferedRe... | 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 8 | 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 | 0827d0beaf1d2f38bce0c65d5d999510 | 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.io.PrintWriter;
//import java.text.DecimalFormat;
import java.util.*;
public class Codeforces {
static long mod = 1000000007 ;
public static void main(String[] args) throws Exception {
PrintWrite... | 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 8 | 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 | b128bc0ec643dd9f022c902464746154 | 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.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class E123B {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.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 8 | 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 | f2bc6d02dc0f4b349744e60b507f8623 | 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 Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0) {
solve(sc);
}
}
static void solve(Scanner sc) {
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 8 | 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 | c73e01715515d9c5ee02d04848712cb0 | 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 AntiFibonacciPermutation {
public static void main(String[] args) throws IOException {
Reader in = new Reader();
PrintWriter out = new PrintWriter(System.out);
int T = in.nextInt();
for (int t = 0; t < T; 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 8 | 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 | 21bd182b53c97a52a4be2ab647a37784 | 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 B_Anti_Fibonacci_Permutation {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while (t-- > 0) {
int n = s.nextInt();
int arr[] = new int[n];
for (int 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 8 | 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 | 42839a1be16c5efe36d427391704829d | 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.BigInteger;
import java.util.*;
import java.lang.*;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import static java.lang.Math.sqrt;
import static java.lang.Math.pow;
import static java.lang.Math.ceil;
import java.math.... | 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 8 | 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 | 6c6d9b694e0886e62b03a2410fa127d6 | 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 s = new Scanner(System.in);
int num = s.nextInt();
int[] arr = new int[num];
for (int i = 0; i < num; i++) {
arr[i] = s.nextInt();
}
s.close();
for... | 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 8 | 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 | 0fdb3c51d6a1f9151bcb184884090ab1 | 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 B1644 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t=0; t<T; t++) {
int N = in.nextInt();
if (N == 3) {
System.out.println("3 2 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 8 | 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 | 8e3da9f7cdc85ba47441b4d8fd6c90f6 | 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.*;
import javafx.scene.layout.Priority;
public class Main
{
public static void main(String args[])
{
FastScanner input = new FastScanner();
StringBuilder result = 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 8 | 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 | 6cb51d1b027cacd47660d4dd133eeeff | 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.awt.Desktop;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URI;
import java.net.URISyntaxException;
import java.sql.Array;
import java.util.ArrayDeque;
import java.util.ArrayList;
import ja... | 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 8 | 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 | c32f123b8c9ef99a01f6f04ca77dbe5c | 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 algorithm;
import java.util.Scanner;
/**
* @author Jeffrey.X.Sun
* @date 2022/3/17 8:48
*/
public class AntiFibonacci {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int times = scanner.nextInt();
int[] nums = new int[times];
... | 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 8 | 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 | 90cb537c374135de49abf0f89964243d | 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.InputMismatchException;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
... | 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 8 | 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 | 70b0ee7efce7fff261669cb639e4537a | 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.InputMismatchException;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
... | 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 8 | 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 | b1a76d5a098a686bc1082f563ff3c6e8 | 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.awt.*;
import java.util.*;
import java.io.*;
public class Codeforces {
static FScanner sc = new FScanner();
static PrintWriter out = new PrintWriter(System.out);
static final Random random = new Random();
static long mod = 1000000007L;
static HashMap<String, Integer> map = 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 8 | 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 | 4f7ac8da8bc100bb74c1f7c3357fbc75 | 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 Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int m = sc.nextInt();
while (m-- > 0) {
int n = sc.nextInt();
for (int i = 1; i <= n; i++) {
System.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 8 | 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 | afe01142519571f995afa4a3f55208a5 | 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 Map<Integer, List<LinkedList<Integer>>> memo = new HashMap<>();
private static void solve(int t){
List<LinkedList<Integer>> res = helper(t);
int count = 0;
for(LinkedList<Integer> l: res){
Iterator 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 8 | 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 | 394cfdae8f8a5bfb9585df046c897ef3 | 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
{
Scanner c=new Scanner(System.in);
int t;
t=c.nextInt();
while(t-->0){
int n=c.nextInt();
for(int i=1;i<=n;i++){
System.out.print(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 8 | 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 | 4554e2c2bd56fb88d4b3b346be91d48c | 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 antifib {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
while(T-- > 0) {
int N = Integer.parseInt(br.readLine());
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 8 | 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 | 3549f54c828505efb3c10ca9b053575e | 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 Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n= sc.nextInt();
if(n==3){
System.out.println("3 2 1\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 | b691c410537a0298c26485790ce5a652 | 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 codeforce;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.io.*;
public class A {
static class Node {
int id1;
int id2;
Node(int v1, int w1){
this.id1= v1;
this.id2=w1;
}
Node(){}
// int index() {
// retu... | 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 | f7131bf8d087c0be5315c98a8d29bcc1 | 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;
// Java implementation of the approach
import java.io.*;
import java.util.Arrays;
import java.util.*;
import java.util.Queue;
import java.util.Scanner;
public class ww {
public static void main(String[] args) throws IOException {
// Scanner Reader = new Scanner(System.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 | 44a65a2fddfb4b539e3ec536b8999a35 | 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 static java.lang.Math.sqrt;
import static java.lang.Math.pow;
import static java.lang.System.out;
import static java.lang.System.err;
import java.util.*;
import java.io.*;
import java.math.*;
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 | 9956973289959e92b50e5b0984837c13 | 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 javax.swing.*;
import java.util.*;
public class Solution {
static int count;
static int n;
public static void main(String[] args) throws Exception {
try {
Scanner scan = new Scanner(System.in);
int test = scan.nextInt();
for (int 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 | 024b95b1f92868bcd92a08338ec9bb11 | 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 MainB {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
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 | c2be7368bbdd47678ee62effb25e5fef | 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.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.security.cert.X509CRL;
import java.util.*;
import java.lang.*;
import java.util.stream.Collector;
import java.util.stream.Co... | 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 | ec24fdbb55f48fb0daf030a6267d409b | 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 antiFib{
public int[] shift(int ar[], int rotate){
int p[] = new int[ar.length];
for(int i=0;i<ar.length-rotate; i++){
p[i+rotate] = ar[i];
}
int a =ar.length-rotate;
for(int i= 0; i<rotate; i++){
p[i] = ar[a];
a++;
}
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 | 29d626ed1d6dd7ce6b35017c7c02e593 | 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 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 | ["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 | 94d2d1083f07cf87b519e731d17ca6b9 | 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 AntiFibonacciPermutation {
public static void main(String[] args){
Kattio io=new Kattio();
int t=io.nextInt();
while(t>0) {
int n=io.nextInt();
for(int i=1;i<n+1;i++) {
io.print(i);
for(int j=n;j>0;j--) {
if(j!=i) {
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 | e458765e57932a775580ea7c7ab5bf4f | 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 example {
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 = new 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 | 227b68fc528fb490ef08891ead6b9a35 | 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.Scanner;
import java.util.StringTokenizer;
import java.util.*;
public class Main {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new Buf... | 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 | abb36b332fbe03d63fb0abec90bf3829 | 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 Anti_FibonacciPermutation {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
int t = sc.nextInt();
while(t--!=0)
{
int test = sc.nextInt();
int[] arr = new int[test];
int count = test;
for(int i =0;i<arr.length;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 | 60605504491152bd62e2dc9db34e9d31 | 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 SolnB {
static boolean checkPerfectSquare(double number)
{
double sqrt=Math.sqrt(number);
return ((sqrt - Math.floor(sqrt)) == 0);
}
static boolean checkPerfectCube(double number)
{
double cbrt=Math.cbrt(number);
return ((cbrt - Ma... | 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 | c052cddd428036e0cc84b688660fc20b | 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 SolnB {
static boolean checkPerfectSquare(double number)
{
double sqrt=Math.sqrt(number);
return ((sqrt - Math.floor(sqrt)) == 0);
}
static boolean checkPerfectCube(double number)
{
double cbrt=Math.cbrt(number);
return ((cbrt - Ma... | 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 | a746c8d07104ce2eec883d3bba5aaf16 | 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.io.PrintWriter;
import java.util.*;
public class Test
{
final static FastReader fr = new FastReader();
final static PrintWriter out = new PrintWriter(System.out) ;
static long mod = (long)... | 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 | 061bace549fcaad7994db6f05dcb3255 | 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.io.PrintWriter;
import java.util.*;
public class Test
{
final static FastReader fr = new FastReader();
final static PrintWriter out = new PrintWriter(System.out) ;
static long mod = (long)... | 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 | 4d46e138c5a2b666cfecdf44b98a21fa | 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.*;
/* Name of the class has to be "Main" only if the class is public. */
public class test {
public static void main(String[] args) throws java.lang.Exception {
Scanner scanner = new Scanner(System.in);
Integer len = scanner.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 | fec59ae9cba0016fa3268cf43b943b5a | 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.*;
public class solution
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
while(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 | a69dd22d7f73a65e2d6f35b59c9084f5 | 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.codeforces.ERound123;
import java.io.*;
public class pr02 {
public static void main(String[] args)throws IOException {
Reader scan=new Reader();
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int t=scan.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 | cccf8634dc74c0be60f3959dd47433e6 | 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{
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
for(int k =0 ; k < t ;k++){
int n = scn.nextInt();
int[]arr = 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 | 5be9576ee3f1eee77c01607b94447b10 | 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 antifib{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
if(n>2){
int arr[]=new int[n];
for(int i=0;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 | 86736e236279ab3f28c3cae3ad7311f5 | 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 AntifibonacciNumbers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
int n = sc.nextInt();
ArrayList<Integer> arr = new ArrayList<>();
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 | 0819f7fdb57d04856815f70e25996efd | 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 div2
{
public static void main(String[] args) throws IOException
{
Reader sc=new Reader();
int t=sc.nextInt();
while(t-->0)
{
int n=sc.nextInt();
int a[]=new int[n];
int p=0;
for(int i=n-1;i>=0;i--)
{
a[p++... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.