摘要:
完全想不出来正解,暴力t了过不了 class Solution { public boolean isUgly(int n) { if (n == 1) { return true; } if (n <= 0) { return false; } outer:for(int i = 2; i < n 阅读全文
摘要:
没想到我现在能卡在这样的题目上 leetcode258各位相加 只尝试了循环模拟,一开始代码是这样的。 class Solution { public int addDigits(int num) { int temp; do { while(num != 0) { temp += num % 10 阅读全文
摘要:
耗费了两天$AC$了线段树的两道模板。就把我自己的代码贴出来以后$DEBUG$的时候做个参考吧。 线段树壹 #include <cstdio> typedef long long ll; const int N = 100000+10; int n,m; ll a[N]; struct Segmen 阅读全文