equal

thymeleaf th:if表达式语法

风流意气都作罢 提交于 2019-12-01 02:07:30
1.比较运算符 gt:great than(大于)> ge:great equal(大于等于)>= eq:equal(等于)== lt:less than(小于)< le:less equal(小于等于)<= ne:not equal(不等于)!= 2.网页应用 <td class="td-status" th:if="${product.status} eq 1"> <span class="label label-success radius">已上架</span> </td> <a th:if="${product.status} ne 2 " class="ml-5" href="javascript:;" title="发布秒杀"> <i class="Hui-iconfont">&#xe603;</i> </a> 来源: https://www.cnblogs.com/liabin/p/11647319.html

shell equal

瘦欲@ 提交于 2019-11-30 23:52:52
#!/bin/sh zero=0 status=1 let status=0 if [[ $status -eq $zero ]];then echo "bu >= 3.6" else echo ">= 3.6" fi 来源: https://www.cnblogs.com/sea-stream/p/11645112.html

1072. Flip Columns For Maximum Number of Equal Rows

…衆ロ難τιáo~ 提交于 2019-11-30 19:50:58
1072. Flip Columns For Maximum Number of Equal Rows Medium 131 14 Favorite Share Given a matrix consisting of 0s and 1s, we may choose any number of columns in the matrix and flip every cell in that column. Flipping a cell changes the value of that cell from 0 to 1 or from 1 to 0. Return the maximum number of rows that have all values equal after some number of flips. Example 1: Input: [[0,1],[1,1]] Output: 1 Explanation: After flipping no values, 1 row has all values equal. Example 2: Input: [[0,1],[1,0]] Output: 2 Explanation: After flipping values in the first column, both rows have equal

Java 中的equal()和hascode()方法

杀马特。学长 韩版系。学妹 提交于 2019-11-30 19:31:52
equals()反映的是对象或变量具体的值,即两个对象里面包含的值--可能是对象的引用,也可能是值类型的值。 而hashCode()是对象或变量通过哈希算法计算出的哈希值。 之所以有hashCode方法,是因为在批量的对象比较中,hashCode要比equals来得快,很多集合都用到了hashCode,比如HashTable。 两个obj,如果equals()相等,hashCode()一定相等。 两个obj,如果hashCode()相等,equals()不一定相等(Hash散列值有冲突的情况,虽然概率很低)。 所以: 可以考虑在集合中,判断两个对象是否相等的规则是: 第一步,如果hashCode()相等,则查看第二步,否则不相等; 第二步,查看equals()是否相等,如果相等,则两obj相等,否则还是不相等。 1、首先equals()和hashcode()这两个方法都是从object类中继承过来的。 equals()是对两个对象的地址值进行的比较(即比较引用是否相同)。 hashCode()是一个本地方法,它的实现是根据本地机器相关的。 2、Java语言对equals()的要求如下,这些要求是必须遵循的: A 对称性:如果x.equals(y)返回是“true”,那么y.equals(x)也应该返回是“true”。 B 反射性:x.equals(x)必须返回是“true”。 C

java面试(2)

℡╲_俬逩灬. 提交于 2019-11-30 13:22:57
问题1、ArrayList去重 答:1、利用HashSet(不保证元素顺序一致)   HashSet不会存在相同的元素,可以利用这一点去除List中的重复元素    List<String> beforeList = new ArrayList<String>(); beforeList.add("sun"); beforeList.add("star"); beforeList.add("moon"); beforeList.add("earth"); beforeList.add("sun"); beforeList.add("earth"); Set<String> middleHashSet = new HashSet<String>(beforeList); List<String> afterHashSetList = new ArrayList<String>(middleHashSet); System.out.println(beforeList); System.out.println(afterHashSetList);   2.利用LinkedHashSet (去重后顺序一致) List<String> beforeList = new ArrayList<String>(); beforeList.add("sun"); beforeList.add(

1215C - Swap Letters

烈酒焚心 提交于 2019-11-30 02:09:01
C. Swap Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Monocarp has got two strings ss and tt having equal length. Both strings consist of lowercase Latin letters "a" and "b". Monocarp wants to make these two strings ss and tt equal to each other. He can do the following operation any number of times: choose an index pos1pos1 in the string ss, choose an index pos2pos2 in the string tt, and swap spos1spos1 with tpos2tpos2. You have to determine the minimum number of operations Monocarp has to perform to make ss and tt equal,

Square Filling(greedy)

冷暖自知 提交于 2019-11-29 12:27:52
You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0. You may perform some operations with matrix B. During each operation, you choose any submatrix of B having size 2×2, and replace every element in the chosen submatrix with 1. In other words, you choose two integers x and y such that 1≤x<n and 1≤y<m, and then set Bx,y, Bx,y+1, Bx+1,y and Bx+1,y+1 to 1. Your goal is to make matrix B equal to matrix A. Two matrices A and B are equal if and only if every element of matrix A is equal to the

B. Equal Rectangles ( Codeforces Round #579 )

爱⌒轻易说出口 提交于 2019-11-28 16:42:35
You are given 4 n 4n sticks, the length of the i i-th stick is a i ai. You have to create n n rectangles, each rectangle will consist of exactly 4 4 sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that each stick can be used in only one rectangle. Each stick should be used as a side, you cannot break the stick or use it not to the full length. You want to all rectangles to have equal area. The area of the rectangle with sides a a and b b is a ⋅ b a⋅b. Your task is to say if it is possible to

Educational Codeforces Round 71 (Rated for Div. 2) B - Square Filling

北战南征 提交于 2019-11-28 10:08:23
原文链接: https://www.cnblogs.com/xwl3109377858/p/11404261.html Educational Codeforces Round 71 (Rated for Div. 2) B - Square Filling You are given two matrices A and B. Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1; each element of B is initially 0. You may perform some operations with matrix B. During each operation, you choose any submatrix of B having size 2×2, and replace every element in the chosen submatrix with 1. In other words, you choose two integers x and y such that 1≤x<n and 1≤y<m, and then set Bx,y, Bx,y+1, Bx+1,y and Bx+1,y+1 to 1. Your goal

[暴力] Educational Codeforces Round 71 (Rated for Div. 2) B. Square Filling (1207B)

本秂侑毒 提交于 2019-11-28 08:39:27
题目: http://codeforces.com/contest/1207/problem/B B. Square Filling time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given two matrices A and B . Each matrix contains exactly n rows and m columns. Each element of A is either 0 or 1 ; each element of B is initially 0 . You may perform some operations with matrix B . During each operation, you choose any submatrix of B having size 2 × 2 , and replace every element in the chosen submatrix with 1 . In other words, you choose two integers x and y such that 1 ≤ x < n and 1 ≤ y < m ,