import random from random import choice ops = ('+','-','×','÷') ans = [] i=0 while i < 100 : op1 = choice(ops) op2 = choice(ops) n = random.randint(1,9) if op1 == '+' and op2 == '+' : a = random.randint(0,100) b = random.randint(0,100-a) c = random.r
[UOJ#82][UR #7]水题生成器(贪心) 题面 UOJ 题解 把\(n!\)的所有约数搜出来,这个个数不会很多. 然后从大往小能选则选就好了. #include<iostream> #include<cstdio> #include<algorithm> #include<vector> using namespace std; #define ll long long int n;ll m; vector<ll> ys; int p[2
1:主方法 package com.baidu; import java.text.NumberFormat;import java.util.ArrayList;import java.util.Stack; public class CalculateStack { static private CalculateStack cl = new CalculateStack(); //申明一个存放数字元素的栈 private Stack<String> num = new Stack<