1 #导入需要的模块 2 import torch 3 import torch.nn as nn 4 import torch.optim as optim 5 import torch.nn.functional as F 6 import torch.backends.cudnn as cud ...
分类:
Web程序 时间:
2020-04-12 12:28:37
阅读次数:
80
原题地址:https://www.jisuanke.com/contest/7195?view=challenges A. Electric Bill 题意:分级收费,用电1000以下一档,以上一档,问应支付多少钱 AC代码: #include<iostream> #include<cstring> ...
分类:
其他好文 时间:
2020-04-12 00:00:21
阅读次数:
79
动态规划在计算机中是一个比较玄学的算法,有的人可能看很久都很疑惑这到底是怎么回事,但是一旦理解了,上手就非常容易了。 算法描述 (以下内容来自百度百科)动态规划(dynamic programming)是运筹学的一个分支,是求解决策过程(decision process)最优化的数学方法。20世纪5 ...
分类:
编程语言 时间:
2020-04-11 00:21:44
阅读次数:
85
``` #include #include #define int long long using namespace std; const int N=4010,mod=1e9+7; int a[N]; int e[N*N],ne[N*N],idx,h[N]; int st[N]; int ans... ...
分类:
其他好文 时间:
2020-04-09 10:53:11
阅读次数:
150
``` #include #include #include #include #include #include using namespace std; #define LL long long const int N=1010; int val[N][N]; int res[N][N]; ch... ...
分类:
其他好文 时间:
2020-04-09 10:34:36
阅读次数:
114
通过编程思想来解决程序的问题: 面向过程编程思想 面向对象编程思想 面向切面编程思想 面向接口编程思想 面向对象编程思想(OOP Object Oriented Programming): 面向对象是基于面向过程的编程思想 面向过程强调的是每一个功能步骤 面向对象强调的是由对象去调用功能 面向对象编 ...
分类:
其他好文 时间:
2020-04-09 00:51:33
阅读次数:
82
School of Computer Science, McGill UniversityCOMP-206 Introduction to Software Systems, Winter 2020Mini Assignment 6: C Programming - Dynamic MemoryTh ...
分类:
其他好文 时间:
2020-04-08 19:35:06
阅读次数:
84
Java面向对象(Object Oriented Promgramming) 学习面向对象内容的三条主线 1. Java类及类的成员 2. 面向对象三大特征 3. 其他关键字 面向对象 概念 Java是面向对象的编程语言,与面向过程(procedure oriented programming)相对 ...
分类:
编程语言 时间:
2020-04-08 19:06:19
阅读次数:
76
bind()是一个函数模板,它的原理是根据已有的模板,生成一个函数,但是由于bind()不知道生成的函数执行的时候,传递进来的参数是否还有效。所以它选择参数值传递而不是引用传递。如果想引用传递,std::ref和std::cref就派上用场了。 #include <functional>#inclu ...
分类:
其他好文 时间:
2020-04-07 21:00:27
阅读次数:
91
E题:Opposites Attract 题目链接:https://nanti.jisuanke.com/t/44821 题目大意: 题目明确了圆盘上各块的得分,给出m(t)个点,问这些点在圆盘上的分数总和。 思路: 一个2π的圆,可以想到用弧度来确定点的位置(一开始做的时候用的角度,却WA了),弧 ...
分类:
其他好文 时间:
2020-04-07 20:49:50
阅读次数:
70