NO捷径只有量变引起质变

110

laterya
msjj

zqc.AC
Idlike_0

import java.util.Scanner;
import java.io.*;
public class Main{
private static int[] st;
private static boolean[] path;
private static int n;
private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
st= new int[n];
path = new boolean[n];
dfs(0);
bw.flush();
}
private static void dfs(int u) throws Exception{
if(u == n){
for(int i = 0;i < n; i++)
bw.write(st[i] + " ");
bw.write("\n");
}
else{
for(int i = 0;i<n;i++){
if(!path[i]){
path[i] = true;
st[u]= i+1;
dfs(u+1);
path[i] = false;
}
}
}
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


class Solution{
public void deleteNode(ListNode node){
ListNode p = node.next;
node.val = p.val;
node.next = p.next;
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int l = sc.nextInt(),r = sc.nextInt();
int[] a = new int[N];
for(int i =0;i<N;i++){
a[i] = sc.nextInt();
}
uzpx(a,l,r);
}
public static void uzpx(int[] a,int l,int r){
for(int i = l;i<=r;i++){
for(int j = l;j<i;j++){
if(a[i]<a[j]){
int m = a[i];
a[i] = a[j];
a[j] = m;
}
}
}
for(int i = 0 ;i<a.length;i++){
System.out.print(a[i]+" ");
}
System.out.println();
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt(),b = sc.nextInt();
System.out.println(gcd(a,b));
}
public static int gcd(int a,int b){
return a%b!=0 ? gcd(b,a%b):b;
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc =new Scanner(System.in);
int x =sc.nextInt(),y = sc.nextInt();
int[][] a = new int[x][y];
for(int i = 0;i<x;i++){
for(int j = 0 ;j<y;j++){
a[i][j] = sc.nextInt();
}
}
print2D(a,x,y);
}
private static void print2D(int[][] a,int x ,int y){
for(int i = 0 ;i<x;i++){
for(int j =0;j<y;j++){
System.out.printf("%d ",a[i][j]);
}
System.out.println();
}
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(max(a,b));
}
public static int max(int x,int y){
return x>y ? x:y;
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
if(n==0) break;
String[] strs = new String[n];
for(int i=0;i<n;i++){
strs[i] = sc.next();
}
StringBuilder sb = new StringBuilder();
for(int i = 1;i<=strs[0].length();i++){
boolean flag = true;
char c = strs[0].charAt(strs[0].length()-i);
for(int j = 1;j<n;j++){
if(i> strs[j].length() || strs[j].charAt(strs[j].length()-i)!=c){
flag = false;
break;
}
}
if(flag) sb.append(c);
else break;
}
sb.reverse();
System.out.println(sb);
}
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] s = sc.nextLine().split(" ");
for(int i = s.length-1;i>=0;i--){
System.out.print(s[i]+ " ");
}
}}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] strs = sc.nextLine().split(" ");
String a = sc.next(),b = sc.next();
for(String str:strs){
if(str.equals(a)){
System.out.printf("%s ",b);
}
else{
System.out.printf("%s ",str);
}
}
}
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~