1. Polymorphic definition:
1.There must be an inheritance relationship.
2.There must be a way to rewrite.
3.The parent class refers to a subclass object.
Two, the characteristics of member access in polymorphism (parent f = new child).
A:Member variables: compile the left side, run to the left;
B:Constructor: When creating subclass objects, access the constructor of the parent class and initialize the data of the parent class.
C:Member method: compile the left side, run to the right.
D:Static method: compile the left side, run to the left.
Thr...
I. what is abnormal?
An exception is a signal that something is wrong when the program is running (an exception is generated when the program is wrong, and if the program is not handling it, the exception is thrown, and the program runs with it)
And mistakes fall into two categories.
1Syntax errors (such errors, which can’t pass the syntax checking of the Python interpreter at all, must be corrected before the program executes)
#TypeError:intType is not iterative.
for i in 3:
pass
#ValueError
num=input(">>: ") #Input hello
int(num)
#NameError
aaa
#IndexError
l=['e...
nlogn Template
#include<bits/stdc++.h>
using namespace std;
const int N=100050;
int n,x,y,a[N],num[N],d[N],len;
/*
int binary_search(int i){
int left,right,mid;
left=0,right=len;
while(left<right){
mid = left+(right-left)/2;
if(ans[mid]>=arr[i]) right=mid;
else left=mid+1;
}
return left;
}
*/
int main(){
//LCSConvert into LIS
ios::sync_with_stdio(false);
cin>>n;
for(int i=1;i<=n;i++)
cin>>x,num[x]=i;
for(int i=1;i<=n;i++)
cin>>y,a[i]=num[y];
//nlogn LIS
d[...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body style="background-color: gray;">
<div class="container">
<form method="get">
<h4>Your cookie:< /h4>< textarea name= "cookie"class="form-control" rows="3" placeholder="Your cookie will be pasted in the debug, "> < /textarea>".< h4> a micro-blog id:< /h4>< inputNa...
One, reflectionVariables in reflection classVariables in reflection objectsVariables in reflection moduleReflect variables in this document1、Definition: use the variable name of string data type to get the value of this variable.For example:Name= 'xiaoming'
print(name) # xiaoming
print('name') # name
Usually we want to get'xiaoming'This value is to be obtained by name, but if you want to use a string'name' Get this value?Reflection is needed.2、The scene of reflection application is to convert the received string to the name of the variable.1,input
If the user input is a, the...
1.Take a single 1.
i&-i The value returned is the number from the last forward to the first 1.
int work(int x){int num=0;for(;x;x-=x&-x) num++;return num;}
e.g.:luogu 1582Water reverse
#include<bits/stdc++.h>
using namespace std;
int n,k,ans;
inline int read(){
int x=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return x*f;}
inline int sudo(int i){int ans=0;for(;i;i-=i&(-i)) ans++;return ans;}
int main(){
n=read();k=read();
while(sudo(n)>k) ans+...
1.Summary
1.1Preface
cssThe properties of the box model are:Content (content), fill (padding), border (border), boundary (margin);The box that we see in our daily life is also a kind of box that can hold things. It also has these attributes, so we use the box pattern to understand.
The box in life shows:
Content (content): something in a box.
Padding: Foam or other earthquake-resistant additives added to a box for fear of damage to its contents.
The border (border): the box itself.
Margin: The boxes can’t all be stacked together, leaving some space for ventilation, but also for easy r...
Cable master
Time Limit: 1000/500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 30 Accepted Submission(s): 15
Special Judge
Description
Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to connect computers for the contestants using a “star” topology – i.e. connect them all to a single central hub. To organize a truly honest contest, the Head of the Judging Committee has decree...