循环单链表 #1770: [编程入门]链表之报数问题&约瑟夫环(C++) 这道题如果用不带头结点的循环单链表会少去两个特判奈何作者带头结点的写习惯了,不带头结点的一时不会写了```#include#defineMAX0x3f3f3f3f#defineMIN-0x3f3f3f3fusingnamespacestd;typedeflonglongll;intn, 题解列表 2024年11月24日 0 点赞 0 评论 582 浏览 评分:0.0
直接写就得了 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a; float b=0; scanf("%d",&a); if(a<=1000…… 题解列表 2024年11月24日 0 点赞 0 评论 386 浏览 评分:0.0
最普通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int i,a; double b=30.0; scanf("…… 题解列表 2024年11月24日 0 点赞 0 评论 405 浏览 评分:0.0
安之 用STL模拟栈的方法 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ //3 123 321 //3 123 312 ve…… 题解列表 2024年11月24日 0 点赞 0 评论 470 浏览 评分:0.0
最复杂的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,j,a,k,b=0,c=0,d=0,e=0,f=0; scanf("%d",&a); …… 题解列表 2024年11月24日 0 点赞 1 评论 447 浏览 评分:0.0
A+B for Input-Output Practice (IV) #includeusingnamespacestd;intmain(){inti=0,n;inta,sum=0;while(cin>>n){if(n==0)break;else{while(i>a;sum+=a;++i;}cout 题解列表 2024年11月24日 0 点赞 0 评论 577 浏览 评分:0.0
区间dp+前缀和 #1898: 蓝桥杯算法提高VIP-合并石子(C++) n堆石子,挑选任意一端区间[L,R]我们用F[L,R]表示从L到R合并为一堆所需要的**最小代价**枚举一个切分点,把区间分割为[L,K]-[K+1,R],那么问题就转为合并L->K,K+1->R这两堆石子的代价这其中我们还可以用前缀和数组来快速求合并[L, 题解列表 2024年11月24日 0 点赞 0 评论 432 浏览 评分:0.0
字符串形式求解阶乘和数-C(一点小见解......) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int fact(int num);int main(){ int num=0,j=0,sum…… 题解列表 2024年11月24日 0 点赞 0 评论 556 浏览 评分:0.0
A+B for Input-Output Practice (V) #includeusingnamespacestd;intmain(){inti=0,j=0;intN,n;inta,sum=0;cin>>N;for(i=0;i>n;while(j>a;sum+=a;++j;}cout 题解列表 2024年11月24日 0 点赞 0 评论 473 浏览 评分:0.0
后缀表达式的值!? 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义一个栈,用于存储操作数 stack<long long> st;…… 题解列表 2024年11月24日 1 点赞 0 评论 503 浏览 评分:0.0