题解列表
优质题解
[编程入门]结构体之时间设计
摘要:解题思路:首先定义一个时间结构体Date,其成员包括year,month,day分别表示年,月,日。然后在main函数中定义结构体变量,再定义一个sum用来保存输入日期是该年的第几天,为了后续方便计算……
#C++1115——DNA二维数组
摘要:#include<iostream>
using namespace std;
int main()
{ int p;
cin>>p;
while(p)
{
int a,b,j……
2065: [STL训练]{A} + {B}(set)
摘要:解题思路:set集合自带默认升序和去重功能。参考代码:#include <bits/stdc++.h>
#define ll long long
using namespace std;
……
1862: 求两个集合交集(set)
摘要:解题思路:使用vector也可以做,但是vector的find是朴素查找,时间复杂度是O(n)而set的增删查改都是O(log n)级别,速度更快参考代码:#include <bits/stdc++.……
2114——————阶乘和
摘要: n = int(input())
m = 1
s = 0
for i in range(1,n+1):
m = m*i
s =……
2211——————数据交换
摘要: a,b = map(int,input().split())
print(b,a) #凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数……
优质题解
字符串的输入输出处理(C语言)
摘要:[字符串的输入输出处理](http://www.dotcpp.com/oj/problem1094.html "字符串的输入输出处理")
**解题思路**
1. 先把前N个字符串用gets()……
题解 1594: 蓝桥杯算法训练VIP-Hanoi问题 汉诺塔
摘要:#include<iostream>
#include<cstdio>
using namespace std;
int n;
int count;
void Hano(int n, int……
2212——————景点游览
摘要:
n = int(input())
for i in sorted(list(map(int,input().split())))[::-1]:print(i,end=' ')
……