40%的暴力代码:
import java.io.*;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = 100010;
static List<Character> list = new ArrayList<>();
public static void main(String[] args) throws NumberFormatException, IOException
{
long a = rd.nextLong(),b = rd.nextLong();
long n = rd.nextLong();
long cnt = 0; // 记录当前题数
long res = 0; // 记录天数
while(cnt < n)
{
for(int i = 1; i <= 5 ; i ++)
{
cnt += a;
res ++;
if(cnt >= n)
{
pw.println(res);
pw.flush();
return;
}
}
for(int i = 1 ; i <= 5 ; i ++)
{
cnt += b;
res ++;
if(cnt >= n)
{
pw.println(res);
pw.flush();
return;
}
}
}
pw.flush();
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while(!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next()); }
static BigInteger nextBigInteger() throws IOException
{
BigInteger d = new BigInteger(rd.nextLine());
return d;
}
}
class PII implements Comparable<PII>
{
int x,y;
public PII(int x ,int y)
{
this.x = x;
this.y = y;
}
public int compareTo(PII a)
{
if(this.x-a.x != 0)
return this.x-a.x; //按x升序排序
else return this.y-a.y; //如果x相同,按y升序排序
}
}
class Edge
{
int a,b,c;
public Edge(int a ,int b, int c)
{
this.a = a;
this.b = b;
this.c = c;
}
}

这是一个用Java编写的程序,主要使用了Scanner类来读取输入,通过循环和条件判断实现特定计算逻辑。代码涉及数学运算、变量更新以及输出处理,目的是解决一个基于给定参数的计数问题。
775

被折叠的 条评论
为什么被折叠?



