Fibonacci 求一个ac代码参考下 我的总是10分。。。

0
0

void search(queue q, int index) { if (q.empty()) return; queue new_q; long long sum = 0; int start_index = n; while (!q.empty()) { result = (result + sum) % mod; int va = q.front(); q.pop();

        for (int i = start_index; i > va; i--)
        {
            if (a[i] == F[index])
            {
                new_q.push(i);
                result++;
                sum++;
            }
        }
        start_index = va;
    }
    search(new_q,index+1);

}

write answer 切换为英文 切换为中文


转发分享