- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 第8周博客总结
1.方格取数在N*N的方格中,每个格中存入一些数,某人从图的左上角的 AA 点出发,可以向下行走,也可以向右走,直到到达右下角的 BB 点。在走过的路上,他可以取走方格中的数(取走后的方格中将变为数字 00)。此人从 AA 点到 BB 点共走两次,试找出 22 条这样的路径,使得取得的数之和为最大。四维动态规划:#include<bits/stdc++.h>using namespace std;int n, i, j, l, k, x, y, s;int d[55][55], f
2021-10-31 15:20:33 67
原创 Java-Calendar类应用实例
package zkj;import java.io.*;import java.math.*;import java.util.Scanner;import java.util.Arrays;import java.util.TreeSet;import java.util.Iterator;import java.util.Calendar;public class Zz { public static void main(String[] args) throws I
2021-10-25 17:16:13 125
原创 Java结构体+排序
1.结构体的定义主函数类外:public class Zz { static class node { int num; String name; int yw; int ss; int yy; int sum; int One; int Two; }主函数类内: node[]node1=new node[50]; for(int i=1;i<=n;i++) { node1[i]=new node();//<-注意这里.
2021-10-24 15:13:11 3329
原创 同时输入字符和整数
string s; while(cin>>s) { if(s=='+') { } else if(s=='-') { } else{ int n=s.length(); for(int i=0;i<s.length();i++) { double a=(s[i]-...
2021-10-22 09:13:18 774
原创 快速幂:处理指数爆炸
long long fastPower(long long base, long long power) { long long result = 1; while (power > 0) { if (power & 1) {//此处等价于if(power%2==1) result = result * base % 1000; } power >>= 1;//此处等价于power=power/
2021-10-17 22:23:38 188
原创 数据结构——链表
1.基本概念:能够比数组更加高效快捷的实现对数据的输入、增加、删除2.链表:指针回顾:#include<bits/stdc++.h>using namespace std;int main(){ int *p; int a; cin>>a; p=&a; cout<<*p;}单链表代码:#include<bits/stdc++.h>using namespace std;struct poi
2021-10-17 22:04:19 36
原创 2021-10-10
数据结构——链表1.对链表的多次输入(尾插法多次插入)#include <iostream>#include<stdlib.h>using namespace std;struct Node{ int data; Node *next;};class LinkedList{ public: LinkedList(); int shuchu(); void insertList(int x );private: N
2021-10-17 22:03:35 41
原创 DFS练习
1.n皇后(回溯+递归)#include<iostream>using namespace std;int num;int x[200];int sum;bool place(int k){ for(int j = 1;j<k;j++) if(abs(x[k] - x[j]) == abs(k-j)||x[j] == x[k]) return false; return true;}void backtra
2021-10-17 22:02:13 67
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人