the same connected block).Analysis: Offline, delete as insert, each use and check set maintenance connected block number.Code:1#include 2#include string.h>3#include 4 using namespacestd;5 #defineN 4000506 intn,fa[n],m,q[n],ans[n],cnt;7 inthead[n],to[n1],nxt[n1],vis[n],k;8InlinevoidAddintUintv)9 {Tento[++cnt]=v;nxt[cnt]=head[u];head[u]=CNT; One } A intFindintx) - { - intp=Fa[x]; the while(P!=fa[p]) p=Fa[p]; - while(x!=2) { - inttmp=Fa[x]; -fa[x]=p; +x=tmp; - } + r
]; - - //0 - voidInit () + { - for(intI=0; i) + { Afa[i]=i; atcnt[i]=1; - } - } - - intFindset (intx) - { in returnFa[x]!=x? fa[x]=Findset (fa[x]): x; - } to + voidUnion_set (intXinty) - { the intxx=Findset (x); * intyy=Findset (y); $ if(XX==YY)return;//description Two elements are originally part of the same collection returnedPanax Notoginseng Else if(XX//if the root node of x is smaller than the root node of y -
Freshman:Before turning to professional in the NetEase cloud Open class to see MIT's line generation revenue is quite a lot,Sophomore last semester:NetEase Cloud on the AFA of C, repeatedly looked at five or six times, feel not difficult and always feel less what, later looked good bin (excellent specialist teacher) enlightened, saw two times. Good bin data structure is also good, because no such training institutionsBehind in the group of good Friend
of the currency1.txt
AED Emirati dirham 1998-06-01 00:00:00.000
AFA Afghani 1998-06-01 00:00:00.000
... ... ...
... ... ...
ZWD Zimbabwe Dollar 1998-06-01 00:00:00.000
When you log in using a password, you need to enclose the-u username and the post-p password with double quotes.
Note: In addition to being able to execute in the console, BCP can also run bcp in SQL statements by calling a system stored procedure of SQL Server xp_cmdshell. If the firs
System_user ();SELECT Current_User ();SELECT Current_User;Returns the character set of the string strSELECT CHARSET (' AFA ');SELECT last_insert_id (); Last entry insert record ID number5. Cryptographic functionsMD5 ()PASSWORD ();SELECT MD5 (' ROOT ');SELECT PASSWORD (' ROOT ');Password encryption for user passwordsSELECT * from user WHERE user= ' root ' \g;Add password password to add permissions6. Process functionsIFSELECT IF (3>1, ' A ', ' B ');SE
character set of the string strSELECT CHARSET (' AFA ');SELECT last_insert_id (); Last entry insert record ID number5. Cryptographic functionsMD5 ()PASSWORD ();SELECT MD5 (' ROOT ');SELECT PASSWORD (' ROOT ');Password encryption for user passwordsSELECT * from user WHERE user= ' root ' \g;Add password password to add permissions6. Process functionsIFSELECT IF (3>1, ' A ', ' B ');SELECT id,username,if (age>18, ' adult ', ' underage ') from employee;SE
4. system functions
Select version (); current database VERSION
SELECT CONNECTION_ID (); number of connections to the current server
Current database:
Select database ();
Select schema ();
Current user
Select user ();
SELECT SYSTEM_USER ();
SELECT CURRENT_USER ();
SELECT CURRENT_USER;
Returns the STR character set.
Select charset ('Afa ');
SELECT LAST_INSERT_ID (); id of the last insert record
5. encryption functions
MD5 ()
PASSWORD ();
SELECT MD
SYSTEM_USER ();
SELECT CURRENT_USER ();
SELECT CURRENT_USER;
Returns the STR character set.
Select charset ('afa ');
SELECT LAST_INSERT_ID (); ID of the last insert record
5. encryption functions
MD5 ()
PASSWORD ();
SELECT MD5 ('root ');
Select password ('root ');
PASSWORD encryption for user passwords
SELECT * FROM user WHERE User = 'root' \ G;
Add a PASSWORD when adding Permissions
6. Process Functions
IF
Select if (3> 1, 'A', 'B ');
SELECT id,
* from tableName" // db2 imports table data to a file
Db2 "import from fileName. del of del insert into tableName" // import the data in the file to the table in db2
4. Check whether the table exists in DB2
select*from"SYSIBM"."SYSTABLES"wherelower(name)='afa_maintransdtl'
5. Solve the db2 lock table problem:
Db2 "connect to afa"
Db2 "get snapshot for locks on Instance name"
Db2 "terminate"
View the related information, find the locked table,
(0 OutputThe output should is printed on the standard output. For each given input data set, print one, integer number in a, gives the result (the minimum number of sold Iers). An example are given in the following:Sample Input40: (1) 11: (2) 2 32: (0) 3: (0) 53: (3) 1 4 21: (1) 02: (0) 0: (0) 4: (0)Sample Output12SourceSoutheastern Europe 2000a simple tree DP, state transition equation: Basically the same as the last question . DP[NODE][0]+=DP[TREE[NODE][I]][1]; Dp[node][1]+=min (dp[tree[nod
Made a simple music player. With open files inside the computer, select songs to playThe main purpose is to master, open the folder, select the file's 1 Private voidFrm_load (Objectsender, EventArgs e)2 {3Skinengine1.skinfile ="Diamondblue.ssk";4 5MediaPlayer1.settings.autoStart =false;//disable playback on load6Mediaplayer1.url ="f:\\qqpcmgr\\desktop\\ player \\MUSIC\\1.mp3";7 }8 //generic collection, which is used to load the full path of a music fil
Algorithm Essentials: the most difficult point of the Kruskal algorithm is how to determine whether to join the edge (x, Y) after the formation of a ring.The problem can be as follows: judging the two vertices x, y of the Edge (x, Y) is the most connected in the graph (actually forest) Mst. If it is already connected, the joining Edge will form a ring;In the Kruskal algorithm, the merging and finding of the set is Used.and check the Set:1 intGETFA (intK//find the most ancestors2 {3 if(fa[k]=
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.