This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int getGcd(int a, int b) { | |
return b == 0 ? a : getGcd(b, a % b); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct com{ | |
bool operator()( T &t1, T &t2) { | |
if(t1.x != t2.x) { | |
return t1.x < t2.x -->按x降序 | |
} | |
return t1.y > t2.y -->x相等时按y升序 | |
} | |
}; | |
priority_queue<T, vector<T>, com> que; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dreamworldvision.trash; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.PrintWriter; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.util.Date; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
using System; | |
using System.Threading; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Net; | |
using System.Net.Sockets; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WinSock2.h> | |
#include <stdio.h> | |
#pragma comment(lib, "ws2_32.lib") | |
void main() | |
{ | |
//¼ÓÔØÌ×½Ó×Ö | |
WSADATA wsaData; | |
char buff[1024]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline float SIGN(float x) { | |
return (x >= 0.0f) ? +1.0f : -1.0f; | |
} | |
inline float NORM(float a, float b, float c, float d) { | |
return sqrt(a * a + b * b + c * c + d * d); | |
} | |
// quaternion = [w, x, y, z]' | |
Mat mRot2Quat(const Mat& m) { |