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 | 4442f5ff480cf467ad8e7bf13e44f07e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
public class Main2 implements Runnable {
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
priv... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 14bb2ea098bf22c7b8cb87d095bce9fb | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
public class Main2 implements Runnable {
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
priv... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | c53b3e410262e88cc10b6f3238c4c608 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
public class Main2 implements Runnable {
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
priv... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 9630c081b4f1de5f10c536516ebf260e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class permutations {
public static void main(String args[]) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 2b36b89ad581bcff7d4425b519ba1aae | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | // package com.company;
import java.io.IOException;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t>0){
int x = sc.nextInt();
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 0d82eaa9c4c42f8edb5a5f8de3bbdf3e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class a {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int tc = sc.nextInt();
while (tc-- > 0) {
// int n = sc.nextInt();
// List<Integer> list = new ArrayList<>();
// for ... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 2a44d16bfd929744f9d11580022e2928 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main{
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
br = new BufferedReader(new InputStreamReader(System.in));
}
String next(){
whi... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 8488960bfad426ef580c5b850ec56971 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class PrettyPermutations {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//BufferedReader br = new BufferedReader(new FileReader("src/input.txt"));
StringTokenizer st = new... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 0abdb94fdb76c7147368e2447588f1cd | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.*;
public class Codeforces {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new Bu... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 8b60224764f3d560419c61fdd5b66b98 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class codeforces {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
boolean f = false;
int n = sc.nextInt();
StringBuilder sb = new StringBuilder()... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 9828ba5b285710d0a6dc4f7d4ca97f71 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class DiagonalTraversal {
public static void main(String[] args) {
Scanner ref = new Scanner(System.in);
int t = ref.nextInt();
while (t-- > 0) {
long n = ref.nextLong();
if (n % 2 == 0) {
for (int i = 1; i ... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | c43b5f0421ddfda1b2c7e5339f229c99 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java .util.*;
import java .io.*;
public class Main{
public static void main(String[] args){
Scanner scn=new Scanner (System.in);
int t=scn.nextInt();
for(int k=1;k<=t;k++){
int noc=scn.nextInt();
int[]arr=new int[noc];
for(int i=0;i<noc;i++){
arr[i]=i+1;
}
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 8959fb88fef7365cc459bbf6124f19f2 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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];
int start = 0;
if ((n &... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | c7e4033e39cd7c96148637824e9bb98d | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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 = 0; i < n; i++) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | b53163dae168f2004fad9c651326f680 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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 = 0; i < n; i++) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 5b8caf77e46a9ed128800c57457d7c93 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | 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();
if(n % 2 == 0)
System.out.printl... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 40d55d4e7e6874c2523565286468e761 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
public class Solution{
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 1b29dab8b3882464026fc8a2c720aca8 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | //credit for scanner https://gist.github.com/alsuga/85ff07d7a080ec06c762
import java.io.*;
import java.util.*;
public class MyClass {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i = 0; i < t; i++){
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 3c5a1a8514da8d96a3b9869e5316c13e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.io.*;
public class Permutations {
static InputStream is = System.in;
public static void main(String[] args) {
StringBuilder output = new StringBuilder();
int m = ni();
for (int j = 0; j < m; j++) {
int n = ni();
for (int i = 1; i < n - 2; i += 2) {
output.... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d8126cbaae529cc6c5b9964bc855dadd | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.Scanner;
/**
*
* @cancer_survivor
*/
public class Pretty {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int t = input.nextInt();
for(int i=0; i<t;i++){
int n... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | af2fc47db8194aa42c233f44e3a71116 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static int N;
static int[] arr;
static int[] result;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuil... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 6f22274da40bbbd947248073fbb78bb7 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.io.*;
import java.util.*;
public class code1 {
public static void main(String[] args) {
try {
FScan scn = new FScan();
StringBuilder ans = new StringBuilder();
int testCase = scn.nextInt();
for (int i = 0; i < testCase; i++) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | bf9404f230e1f5c52f2ce9cfc90586a3 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class Codechef{
static class InputReader
{
public BufferedReader reader;
public StringTokenizer tok;
public InputReader(InputStream inputStream)
{
reader =new BufferedReader(new InputStreamReader(inputStream));
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | a059ea3c3e3d5ad34987a7757246d04c | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class abc
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n,i,tat,p;
int t=sc.nextInt();
while(t-->0)
{
n=sc.nextInt();
int a[]=new int[n];
for(i=0;i<n;i++)
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 2769a28b1363835f608a0db430f0b32e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class class44 {
public static void main(String arg[])
{
Scanner sc=new Scanner(System.in);
int t,n,i;
t=sc.nextInt();
while(t-->0)
{int temp;
n=sc.nextInt();
int a[]=new int[n];
for(i=0;i<n;i++)
{
a[i]=i+1;
}
if(n%2==0)
{
for(i=0;i<n;i+=2)
{
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 110ddab2432547c62d4460270f272464 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class Solution2 {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0)
{
int n=sc.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++)
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 6620d438a21e7f0f2c61affd75574aa5 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.BigInteger;
/**
__ __
( _) ( _)
/ / \\ / /\_\_
/ / \\ / / | \ \
/ / \\ / / |\ \ \
/ / , \ , / / /| \ \
/ / |\_ /| / / / \ \_\
/ / |\/ _ '_| \ ... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 35d22790b08fde673a4af76474430acb | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import java.io.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(Sys... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 14cb8df304e63607b966b38f5a869964 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
for(int m = 0 ; m < t ; m++) {
int n = s.nextInt();
int odd = 1;
if(n%2 != 0) {
odd = 4... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | c188cce51a56ac755e3d42b5d5db6cf8 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
int n = sc.nextInt();
int[] arr = new int[n];
for(int i=0;i<n;++i){
arr[i] = ... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 3f764878b70357231544262a171958db | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
// import java.io.InputStreamReader;
// import java.util.Scanner;
// import java.util.StringTokenizer;
import java.util.Scanner;
import javax.sw... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | b6c4fb82d411dab36ae35ed1187387f2 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
import java.util.*;
public class AA
{
public static void main(String [] args)
{
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while(t-->0)
{
int n=in.nextInt();
if(n%2==0)
for(int i=2;i<=n;i+=2)
Syst... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 5abc31f5a248f5e1644bb7cc8024cd0e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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 A_Pretty_Permutations {
static class FastReader {
BufferedReader br;
StringTokenizer st;
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | f461be0832e2691aa19ebce46fc2e2b9 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.*;
public class CF736 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int tc=sc.nextInt();
for(int i=0;i<tc;i++){
int n=sc.nextInt();
int arr[]=new int[n];
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 1cce897c562ad62f51eace09e3ecb901 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.security.cert.CollectionCertStoreParameters;
import java.util.*;
import static javax.swing.UIManager.get;
public class Main {
static class Pair implements C... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 6f114734135fc3796eea0bbfccfd974a | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Contest {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int x, t= input.nextInt();
while(t-->0)
{
x=input.nextInt();
if(x%2==0)
{
for(int i=1;i<x-1... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 6d8c39d870baf4bd0dbaa4ff9ec92d45 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class sbr{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0){
int n=s.nextInt();
if(n==1)
System.out.println("1");
else if(n==2)
System.out... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 7b9521f7a621345a4a622d8829457d91 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class SolutionA extends Thread {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 77d24e43736737540466ff2f82c3d28b | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Main{
public static MyScanner sc=new MyScanner();
public static void main(String[] args) {
int t=sc.nextInt();
for(int x=0;x<t;x++) {
int n=sc.nextInt();
if(n%2==0) {
for(int i=1;i<=n;i+=2) {
System.out.print((i+1)+" "+i+" ");
}
}
else {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 438095788299406fc18e8dae87b5fdf3 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for(int i=0;i<n;i++){
int cur = input.nextInt();
if(cur%2==0){
int minus = cur-2;
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d73fd862686916056f0c7bda3ba8fd61 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | //1541A
import java.util.*;
public class PrettyPermutations {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-->0) {
int n = s.nextInt();
if(n%2==0) {
for(int i = 1; i<=n/2; i++) {
System.out.print(2*i+" "+(2*i-1)+" ");
}
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 1ab6b0ea2d1ff8387090f28008bb73ff | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long t = in.nextLong();
for (long i=0; i<t; i++) {
long n = in.nextLong();
if (n%2 == 1) {
for (long j = 1; j <= n-3; j++) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 51aab3127e4ea0a2761e4d0becb18875 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class A{
public static void main(String[] args){
FS sc = new FS();
PrintWriter pw = new PrintWriter(System.out);
int t = sc.nextInt();
whil... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 71bd5a6dc359117e3744fa981a538c0d | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class A{
public static void main(String[] args){
FS sc = new FS();
PrintWriter pw = new PrintWriter(System.out);
int t = sc.nextInt();
whil... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 74ab6459d002069b6aa0343ba02e443b | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int tc=sc.nextInt();
int i;
while(tc>0)
{
int n=sc.nextInt();
if(n%2==0)
{
for(i=1;i<=n;i+=2)
{
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 8a2dea4cad2162c8c8146a3d1e8ea15f | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
// A. Pretty Permutations
public class Main {
static BufferedReader br = new Buffer... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 9307694bf85f45597cfa2ed5602bb652 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
public class codeforces728_A {
private static void solve(FastIOAdapter ioAdapter) {
int n = ioAdapter.nextInt();
if (n % 2 == 1) {
ioAdapter.out.print("3 1 2 ");
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | b09100b340421d29480d6c79b7d59d89 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class solve {
public static void solve(int n){
if(n%2 == 0){
for(int i = 1; i<n; i+=2){
System.out.print((i+1) + " " + i + " ");
// System.out.println();
}
}else{
System.out.print("3 1 2 ");
for(int i=4; i<n; i+=2){
System.out.pri... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 5be4108697b2a8bf7e1e92043c7dff6e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class PrettyPermutations {
public static void solve(int n) {
if(n % 2 == 0) {
for(int i = 1; i <= n; i++) {
System.out.print(((i%2 == 0) ? (i - 1) : (i + 1)) + " ");
}
}
else {
for(... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | cc96e7d93684209b6af71876d90e17d7 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.io.*;
public class test {
public static void solve(int n) {
if(n % 2 == 0) {
for(int i = 1; i <= n; i++) {
System.out.print(((i%2 == 0) ? (i - 1): (i+1))+ " ");
}
System.out.println();
}
else {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 387b5724aef93b41063823dcf2c51b06 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author foysalmac
*/
public class A {
/**
* @param args the command l... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | c17b08bd17cd5880a2d0a4a110217cb7 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author foysalmac
*/
public class A {
/**
* @param args the command l... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | e4a7fd8db87a2139e16492bab85728c9 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author foysalmac
*/
public class A {
/**
* @param args the command l... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | dc8d22254514bd96fbb2588a0ffe4183 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.io.*;
public class A {
public void prayGod() throws IOException {
int t = nextInt();
while (t-- > 0) {
int n = nextInt();
if (n % 2 == 0) {
for (int i = 1; i <= n; i += 2) {
out.printf("%d %d ", ... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 6f94201fe3a11294b2c8f5ce29bc9e8a | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class IncreaseKdecrease {
public static void main(String args[]) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n= Integer.parseInt(re... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 47f04a1034538986882bc604e52faebd | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
for(int i = 0;i<n;i++)
{
int l = s.nextInt();
if(l%2==0)
{
for(int j = 1;j<=l;j++)
{
int temp =j;
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 89693b58168f7b51a1e80cb34c335c1b | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Round728_A {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int tt = sc.nextInt();
while(tt-->0){
int n = sc.nextInt();
if(n%2 == 0){
for(int i=1;i<=n;i++){
if(... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 163797ad76c509e9802869907f84e637 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while (t-- > 0){
int n = s.nextInt();
int[] ar = new int[n+1];
if (n%2 == 0){
for (int i = 1;... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 90b6f54b7ab9afb3e16e6fb482383189 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
long t = sc.nextInt();
while(t-- > 0)
{
int n = sc.nextInt();
for(int i=1;i<n-2;i+=2)
{
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 0c119fd08302cc5560b5f043aad5765a | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
FastReader sc =new FastReader();
int t=sc.nextInt();
while(t-->0)
{
int n=sc.nextInt();
int ar... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | c443dfcfab6d4885758ed1c844c4b615 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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();
int a[] = new int[n];
for(int i=0;i<n;i++){
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | eadb2a238faa73a0aaa87174c9decfd9 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Codeforces
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
int arr[] = new int[test];
for(int i = 0; i<test ; i++)
{
arr[i] = sc.nextInt();
}
int n = 0;
for(int i = 0; i<test; i++)
{
n = a... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 11b9f9d50accaa7906f46c4fb27262d9 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class A {
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==0) {
for(int i=2; i<=n; i+=2) {
System.out.print(i+" "+(i-1)+" ");
}
}
else {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 9fb61e3f442647625c28afe418260fb1 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
public class permutation {
public static void main(String[] args) throws java.lang.Exception{
BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(reader.readLine());
for (in... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 4d441175a04bb52d3bb190aa58070f79 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int test_cases = scn.nextInt();
for(int l = 0 ; l < test_cases ; l++){
int n = scn.nextInt();
// int[] arr = new int... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | fe581c65368b1af6a3136324f7c286a9 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t= sc.nextInt();
while(t-->0){
int n = sc.nextInt();
int a[] = new int[n];
if(n%2==0){
for(int i=0;i<n;i+=2){
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 150c4d5019f875506b46180d293b9abe | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class prettyPermutations {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t!=0){
int n=s.nextInt();
int[] ans=new int[n];
// System.out.print(n+" ");
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 0f487ec6649a2e783ae9c181a9ef1d68 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
/*
𝑛 cats in a line: 1 to 𝑛
2: test cases
2: number of cat
3: number of cat
[1,2] -> [2,1]
[1,2,3] -> [3,2,1]
*/
public class Main {
public static void swap(int a, int b, int[] arr) {
int temp = arr[a];
arr[a] = arr[b];
arr[... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 60003cab5527b54844bee68dbf3b2db9 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
public class Main{
public static void main(String []a) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while(t-->0) {
int n = Int... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 05c29a41b92dfeafbe6ebaf04f9529c7 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | //package pack;
import java.io.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.io.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.io.FileInputStre... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 580c566bb4060399ae5f20df7aaba398 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | /*==============================================
Author : Shadman Shariar ||
Email : shadman.shariar@northsouth.edu ||
University : North South University (NSU) ||
Facebook : shadman.shahriar.007 ||
==============================================*/
import java.io.*;
i... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d98e548f97f18dd6e4a04306d2edf943 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class MyClass
{
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=Int... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 3648fae52376453ea1d6f118cf8721b5 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.io.*;
public class Sol{
static class Pair implements Comparable<Pair>{
int id;int value;
public Pair(int id,int value) {
this.id=id;
this.value=value;
}
@Override
public int compareTo(Pair p)... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 976f375009d3291fe72bd750f24adcaf | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes |
// * * * the goal is to be worlds best * * * //
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class A {
static class Pair implements Comparable<Pair>{
int a;
int b;
Pair(int a , int b... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 7e566292c1506867e3fcda25e9277af8 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
public class q1 {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int tests = Integer.parseInt(br.readLine());
for (int test = 1;test <= tests;test++) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d2181189050a97b897c944650c34d35f | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | //package com.company;
import javax.print.attribute.IntegerSyntax;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
static boolean[] primecheck = new boolean[1000000];
public static void main(String[] args) throws IOException {
OutputStream outputStr... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 658928d0b51fedb9339df878df3d8b90 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Main {
static void swap(int[]arr, int a,int b){
int temp = arr[a];
arr[a] = arr[b];
arr[b] = temp;
}
static long abs(int[] arr, int a,int b){
if ( arr[a]>=arr[b])
return arr[a]-arr[b];
return arr[b]-arr[a];
}
public static boolean isPrime(long n)... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | a15d64e91badecf39f6be5c9d082a688 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | /*
Junaeid As Jknight
Somoy paile dekha koiro
alap-adda-gopposob hobe
cha or coffee er sathe.
------<<<<<<*>>>>>>>>-----
D-33 Problem - Pretty Permutation - 1541A
*/
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReade... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | f570d023c19af81203172edea062cf44 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
import java.util.*;
import java.lang.*;
public class Codechef {
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
di... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | f890d081f873ec6182acbd35bb1cf8f5 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | //Gaurav......
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;
import java.io.*;
import java.util.*;
import java.util.List;
import java.util.stream.C... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 68cfcd42483244bd0e9fbdb8c7a6a92e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | //jiudge: 3905
import java.util.Scanner;
public class J {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for(int i = 1; i <= N; i ++ ) {
int n = sc.nextInt();
if(n % 2 == 0) {
for(int j = 1; j <= n / 2; j ++ ) {
System.out.printf(j * 2 +... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | aedabbbae40f4f35f87c198d9f2c251f | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;
// import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Set;
import java.util.Stack;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.strea... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | ff31098adae1e7fc6659c20efe51cc85 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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.Math.*;
import static java.lang.Math.ceil;
import static java.util.Arrays.sort;
public class Round12 {
public static void main(String[] ar... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d29fda8988e5a7c8076b869d1ce9acea | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class prettyPermutations {
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+1];
for(int i = 1; i<=n; i++) {
arr[i] = i;
}
if(n%2 == 0) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 2d4f0e7c24e895208df732cd05dbcc6b | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 4b300f2af97d8048cbfaa6dba3ac3546 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 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();
for (int i = 0; i < t; i++) {
int a = sc.nextInt();
if(a % 2 == 0){
for (int j = 1; j <= a ; j... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d879a98949791151528dde5ecbc30c07 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.io.*;
public class PrettyPerm
{
public static void main(String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
for(int k = 0; k < t; k++)
{
int n = Integer.parseInt(br.readLine());
int dist;
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 7423becc04a074992bb38cc32c420ed3 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.io.*;
public class A {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while (t>0) {
int n=sc.nextInt();
if (n%2==1) {
for (int i=1;i<=n-3;i+=2) System.out.print(i+1+" "+i+... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 11 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | e5447959a753723f2d39f4d522d81f3c | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class main{
public static void main(String [] args){
Scanner in = new Scanner(System.in);
int nt, n, x;
nt = in.nextInt();
while(nt > 0){
n = in.nextInt();
int [] arr = new int [n];
for(int i = 0; i < n; i ++){
arr[i] = i + 1;
}
for(int i = 0; i <... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 17 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 434ff5da14f1c9fbc06dcd08ce0d197e | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.util.ArrayList;
public class A_Pretty_Permutations{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++){
int n=sc.nextInt();
List<Integer> list=new ArrayList<>()... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 17 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | b65cd3795106f3a826a3b6e7a5f10682 | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.ArrayList;
import java.util.Scanner;
import java.util.stream.IntStream;
public class Problem_1541A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
ArrayList<int[]> ans = new ArrayList<>();
for (int i = 0... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 17 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | d69d530be0e3102da1b7ef3a2f7c26fd | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
public class Solution{
public static void main(String[] args){
int test;
Scanner sc = new Scanner(System.in);
test = sc.nextInt();
for(int i = 0 ; i < test ; i++){
int size = sc.nextInt();
int[] arr = new int[size];
f... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 17 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 94dfc8ec44a6f5645dcc642dea10d97d | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.Scanner;
public class prettyPermutations {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int testCases = sc.nextInt();
while (testCases-- > 0) {
int cats = sc.nextInt();
if (cats %2 == 0) {
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 17 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | 8a30591752025866622f8d95e7b7977f | train_107.jsonl | 1624635300 | There are $$$n$$$ cats in a line, labeled from $$$1$$$ to $$$n$$$, with the $$$i$$$-th cat at position $$$i$$$. They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they mo... | 256 megabytes | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args) throws IOException {
OutputStreamWriter osr = new OutputStreamWriter(System.out);
PrintWriter o = new PrintWriter(osr);
FastReader fr = new FastReader();
... | Java | ["2\n2\n3"] | 1 second | ["2 1 \n3 1 2"] | NoteFor the first test case, there is only one possible permutation that satisfies the conditions: $$$[2, 1]$$$.The second test case was described in the statement. Another possible answer is $$$[2, 3, 1]$$$. | Java 17 | standard input | [
"constructive algorithms",
"greedy",
"implementation"
] | f89bd4ec97ec7e02a7f67feaeb4d3958 | The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 100$$$) — the number of cats. It can be proven that under the constraints of the problem, an ans... | 800 | Output $$$t$$$ answers, one for each test case. Each answer consists of $$$n$$$ integers — a permutation with the minimum total distance. If there are multiple answers, print any. | standard output | |
PASSED | b4cbec08003fca1922e9e26f02ada5d7 | train_107.jsonl | 1624635300 | Farmer John has a farm that consists of $$$n$$$ pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that... | 256 megabytes | //package codeforces;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class solution {
public static void main(String args[]){
Scanner s=new Scanner(System.in);
PrintWriter out=new PrintWriter(Syste... | Java | ["3\n3\n0 2 3\n2\n0 1000000000\n1\n0"] | 2 seconds | ["-3\n0\n0"] | NoteIn the first test case, you can add roads from pasture $$$1$$$ to pasture $$$2$$$ with a time of $$$2$$$, from pasture $$$2$$$ to pasture $$$3$$$ with a time of $$$1$$$, from pasture $$$3$$$ to pasture $$$1$$$ with a time of $$$-3$$$, from pasture $$$3$$$ to pasture $$$2$$$ with a time of $$$-1$$$, from pastu... | Java 11 | standard input | [
"constructive algorithms",
"graphs",
"greedy",
"shortest paths",
"sortings"
] | 7dfe0db5a99e6e4d71eb012fab07685b | The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. Then $$$t$$$ cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of pastures. The second line of each test case contains $$$n$$$ space separated integer... | 1,400 | For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. | standard output | |
PASSED | 81c1649627f3a31d490be8b9150140b3 | train_107.jsonl | 1624635300 | Farmer John has a farm that consists of $$$n$$$ pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that... | 256 megabytes | import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class solution {
public static void main(String args[]){
Scanner s=new Scanner(System.in);
PrintWriter out=new PrintWriter(System.out);
int t=s.next... | Java | ["3\n3\n0 2 3\n2\n0 1000000000\n1\n0"] | 2 seconds | ["-3\n0\n0"] | NoteIn the first test case, you can add roads from pasture $$$1$$$ to pasture $$$2$$$ with a time of $$$2$$$, from pasture $$$2$$$ to pasture $$$3$$$ with a time of $$$1$$$, from pasture $$$3$$$ to pasture $$$1$$$ with a time of $$$-3$$$, from pasture $$$3$$$ to pasture $$$2$$$ with a time of $$$-1$$$, from pastu... | Java 11 | standard input | [
"constructive algorithms",
"graphs",
"greedy",
"shortest paths",
"sortings"
] | 7dfe0db5a99e6e4d71eb012fab07685b | The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. Then $$$t$$$ cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of pastures. The second line of each test case contains $$$n$$$ space separated integer... | 1,400 | For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. | standard output | |
PASSED | 867fb3097d9f7420fa131819e9382d54 | train_107.jsonl | 1624635300 | Farmer John has a farm that consists of $$$n$$$ pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that... | 256 megabytes | //package codeforces;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class solution {
public static void main(String args[]){
Scanner s=new Scanner(System.in);
PrintWriter out=new PrintWriter(Syste... | Java | ["3\n3\n0 2 3\n2\n0 1000000000\n1\n0"] | 2 seconds | ["-3\n0\n0"] | NoteIn the first test case, you can add roads from pasture $$$1$$$ to pasture $$$2$$$ with a time of $$$2$$$, from pasture $$$2$$$ to pasture $$$3$$$ with a time of $$$1$$$, from pasture $$$3$$$ to pasture $$$1$$$ with a time of $$$-3$$$, from pasture $$$3$$$ to pasture $$$2$$$ with a time of $$$-1$$$, from pastu... | Java 11 | standard input | [
"constructive algorithms",
"graphs",
"greedy",
"shortest paths",
"sortings"
] | 7dfe0db5a99e6e4d71eb012fab07685b | The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. Then $$$t$$$ cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of pastures. The second line of each test case contains $$$n$$$ space separated integer... | 1,400 | For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. | standard output | |
PASSED | f1bc886b204b33ff2fdf2c63b3978919 | train_107.jsonl | 1624635300 | Farmer John has a farm that consists of $$$n$$$ pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that... | 256 megabytes | //package codeforces;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class solution {
public static void main(String args[]){
Scanner s=new Scanner(System.in);
PrintWriter out=new PrintWriter(Syste... | Java | ["3\n3\n0 2 3\n2\n0 1000000000\n1\n0"] | 2 seconds | ["-3\n0\n0"] | NoteIn the first test case, you can add roads from pasture $$$1$$$ to pasture $$$2$$$ with a time of $$$2$$$, from pasture $$$2$$$ to pasture $$$3$$$ with a time of $$$1$$$, from pasture $$$3$$$ to pasture $$$1$$$ with a time of $$$-3$$$, from pasture $$$3$$$ to pasture $$$2$$$ with a time of $$$-1$$$, from pastu... | Java 11 | standard input | [
"constructive algorithms",
"graphs",
"greedy",
"shortest paths",
"sortings"
] | 7dfe0db5a99e6e4d71eb012fab07685b | The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. Then $$$t$$$ cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of pastures. The second line of each test case contains $$$n$$$ space separated integer... | 1,400 | For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. | standard output | |
PASSED | f56b2eece5feb5aae0b925e0aa3245d1 | train_107.jsonl | 1624635300 | Farmer John has a farm that consists of $$$n$$$ pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class ProblemC {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int t = Integer... | Java | ["3\n3\n0 2 3\n2\n0 1000000000\n1\n0"] | 2 seconds | ["-3\n0\n0"] | NoteIn the first test case, you can add roads from pasture $$$1$$$ to pasture $$$2$$$ with a time of $$$2$$$, from pasture $$$2$$$ to pasture $$$3$$$ with a time of $$$1$$$, from pasture $$$3$$$ to pasture $$$1$$$ with a time of $$$-3$$$, from pasture $$$3$$$ to pasture $$$2$$$ with a time of $$$-1$$$, from pastu... | Java 11 | standard input | [
"constructive algorithms",
"graphs",
"greedy",
"shortest paths",
"sortings"
] | 7dfe0db5a99e6e4d71eb012fab07685b | The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. Then $$$t$$$ cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of pastures. The second line of each test case contains $$$n$$$ space separated integer... | 1,400 | For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. | standard output | |
PASSED | 2d2afafd9ebeb3eb4bac9f998e38c2d8 | train_107.jsonl | 1624635300 | Farmer John has a farm that consists of $$$n$$$ pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class ProblemC {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int t = Integer... | Java | ["3\n3\n0 2 3\n2\n0 1000000000\n1\n0"] | 2 seconds | ["-3\n0\n0"] | NoteIn the first test case, you can add roads from pasture $$$1$$$ to pasture $$$2$$$ with a time of $$$2$$$, from pasture $$$2$$$ to pasture $$$3$$$ with a time of $$$1$$$, from pasture $$$3$$$ to pasture $$$1$$$ with a time of $$$-3$$$, from pasture $$$3$$$ to pasture $$$2$$$ with a time of $$$-1$$$, from pastu... | Java 11 | standard input | [
"constructive algorithms",
"graphs",
"greedy",
"shortest paths",
"sortings"
] | 7dfe0db5a99e6e4d71eb012fab07685b | The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. Then $$$t$$$ cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of pastures. The second line of each test case contains $$$n$$$ space separated integer... | 1,400 | For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.