由买买提看人间百态

topics

全部话题 - 话题: curval
(共0页)
m******3
发帖数: 346
1
来自主题: JobHunting版 - 讨论下lc最新的那道hard题吧
贴个leetcode讨论区的解答,思想就是一边生成一边计算
void addOperators(vector& result, string nums, string t, long long
last, long long curVal, int target) {
if (nums.length() == 0) {
if (curVal == target)
result.push_back(t);
return;
}
for (int i = 1; i<=nums.length(); i++) {
string num = nums.substr(0, i);
if(num.length() > 1 && num[0] == '0')
return;
string nextNum = nums.substr(i);
if (t.length() > 0) {
addOpera... 阅读全帖
l******6
发帖数: 340
2
来自主题: JobHunting版 - 请教几个题目
3.
struct data{
int idx;
int val;
data(int id , int v):idx(id),val(v){}
};
int wlen = 100M;
int curVal;
int curIdx = 0;
list window;
while(cin >> curVal)
{
while(!window.empty() && window.back().val <= curVal)
window.pop_back();
window.push_back(data(curIdx , curVal));
curIdx ++;
if(curIdx - window.front().idx > wlen)
window.pop_front();
cout << window.front().val< }
j*****n
发帖数: 23
3
#include
#include
#include
#include
#include
#include
#include
using namespace std; //这个最好解释一下不会真的在production上这么写
void jf_eval(string& in_line, unordered_map
//jf 是什么意思?
>>& record)
{
int i_dex = in_line.find_first_of(' ');
string cur_var = in_line.substr(0, i_dex);
vector varibles;
int cur_value = 0, ele = 0;
bool new_variable = true, new_number = true; int ... 阅读全帖
f********t
发帖数: 117
4
来自主题: Database版 - SQL问题请教
either using return id after insert.
select curval ('seq name')
(共0页)