49,436
社区成员




裁纸刀
public class Main {
public static void main(String[] args) {
System.out.println(4 + 19 + (21 * 20));
}
}
刷题统计
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//在此输入您的代码...
long a = scan.nextLong();
long b = scan.nextLong();
long n = scan.nextLong();
long week = n / (a * 5 + b * 2);
long res = week * 7;
n %= (a * 5 + b * 2);
if(n > a * 5){
res += 5;
n -= a * 5;
res += ((n - 1) / b) + 1;
}else {
res += ((n - 1) / a) + 1;
}
System.out.println(res);
scan.close();
}
}
修剪灌木
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//在此输入您的代码...
int n = scan.nextInt();
int max;
for (int i=1;i<=n ;i++) {
max = Math.max(i-1, n-i);
System.out.println(max * 2);
}
scan.close();
}
}
k倍区间
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
long[] arr = new long[n];
long[] yu = new long[k];
long sum = 0;
long count = 0;
for (int i = 0; i <n ; i++) {
arr[i] = sc.nextInt();
count += arr[i];
arr[i] = count;
yu[ (int) (arr[i] % k) ]++;
}
sum += yu[0];
for (int i = 0; i < k ; i++) {
sum += yu[i] * (yu[i] - 1) /2;
}
System.out.println(sum);
}
}