bui huynh duc

@ducbh62cfvn

Viet Nam, Ha Noi

Institution: Birla Institute of Technology, Mesra

https://docs.mapbox.com/help/tutorials/android-navigation-sdk/#getting-started https://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas -----------------iBEACON--------------------- 020106|1AFF5900021511111111111111111111111111111111|00100001C411070000484345544349474F4C4903180000|09094E5246353238333200000000 https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/ The proximity UUID is a standard 16byte/128bit BLE UUID. The proximity UUID is typically unique to a company. The Major / Minor number are used to denote assets within that UUID, common uses are Major numbers being stores (so 65,536 stores possible) with Minor numbers being individual tags within the stores (again 65,536 possible tags per store). -----------------ALT BEACON--------------------- 1BFFFFFFBEAC7777777777777777777777777777777700000000BB0000000…. Bóc tách bản tin theo kỹ thuật: (AltBeacon) Beacon code: The AltBeacon advertisement code. Beaconn= ID gồm 3 thành phần: + UUID: 16 byte. + Major: 2 byte. + Minor: 2 byte. Ref. RSSI: Giá trị RSSI do máy thu ở khoảng cách 1m nhận được theo đưa ra bởi manufacturer. MFG RSDV: Reserved for manufacturer for implement special feature. -----------------EDDYSTONE--------------------- [0303AAFE][0D16AAFE10D80367697468756207]00000000000000000000000000000…… Bóc tách bản tin PDU (EDDYSTONE): - Bit đầu tiên là độ dài m. - Bit tiếp theo là kiểu dữ liệu. Tra tại https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/ - (m-1) bit tiếp theo là giá trị dữ liệu Ví dụ trên slide: - Ta có Service Class UUID là AAFE - Service Data UUID là AAFE. Các dữ liệu theo kèm định dạng bản tin: + Frame Type: 10 – URL frame. + Tx Power: BB - -69 dBm + URL prefix: 10 – https:// + encoded URL: 676F6F676C65 + rear: 00 - .com -----------------MICROSOFT ADVERTISING BEACON--------------------- 1EFF06000109200213E72D660BA7AE4CAF1740C032804ADC3ACEEC382C90AD Beacon Structure: Length (1 byte): Set to 31. 0xFF (1 byte): Fixed value 0xFF. Microsoft ID (2 bytes): Set to 0006 Beacon Data (24 bytes): The beacon data section is further broken down. Note that the Scenario and Subtype Specific Data section requirements will differ based on the Scenario and Subtype. Beacon Data: Scenario Type (1 byte): Set to 1. Version and Device Type (1 byte): The high two bits are set to 00 for the version number; the lower6 bits are set to Device Type values as in section 2.2.2.2.2. Version and Flags (1 byte): The high 3 bits are set to 001; the lower 3 bits to 00000. Reserved (1 byte): Currently set to zero. Salt (4 bytes): Four random bytes. Device Hash (24 bytes): SHA256 Hash of Salt plus Device Thumbprint. Truncated to 16 bytes. package ADVTest2016; import java.util.Scanner; public class Dijikstra { static Scanner scanner = new Scanner(System.in); static int minDist, front, rear, numVertex, currentVertex, tempDistance, destVertex; static int[] distance, queue, stepMap; static int[][] map, adjacentList; static boolean[] visited; static char[] charVertex = { 'A', 'B', 'C', 'D', 'E', 'F' }; public static void main(String[] args) { int testcase = scanner.nextInt(); for (int test = 0; test <= testcase; test++) { front = rear = -1; numVertex = scanner.nextInt(); map = new int[numVertex][numVertex]; stepMap = new int[numVertex]; adjacentList = new int[numVertex][numVertex + 1]; queue = new int[numVertex + 1]; distance = new int[numVertex]; visited = new boolean[numVertex]; for (int i = 0; i < numVertex; i++) { distance[i] = Integer.MAX_VALUE; for (int j = 0; j < numVertex; j++) { map[i][j] = scanner.nextInt(); if (i != j && map[i][j] != 0) { adjacentList[i][adjacentList[i][numVertex]] = j; adjacentList[i][numVertex]++; } } } // destVertex = scanner.nextInt() - 1; //PRINT ADJACENT LIST for (int i = 0; i < numVertex; i++) { for (int j = 0; j <= numVertex; j++) { System.out.print(adjacentList[i][j] + " "); } System.out.println(); } enqueue(0); distance[0] = 0; stepMap[0] = 0; visited[0] = true; while (!isEmpty()) { currentVertex = dequeue(); for (int i = 0; i < adjacentList[currentVertex][numVertex]; i++) { if (!visited[adjacentList[currentVertex][i]]) { enqueue(adjacentList[currentVertex][i]); visited[adjacentList[currentVertex][i]] = true; } tempDistance = distance[currentVertex] + map[currentVertex][adjacentList[currentVertex][i]]; if (tempDistance < distance[adjacentList[currentVertex][i]]) { distance[adjacentList[currentVertex][i]] = tempDistance; stepMap[adjacentList[currentVertex][i]] = currentVertex; } } } //PRINT STEP MAP for (int i = 0; i < numVertex; i++) { System.out.print(charVertex[stepMap[i]] + "-" + distance[i] + " "); } } scanner.close(); } static boolean isEmpty() { return front == rear; } static boolean isFull() { return front != rear && rear == queue.length - 1; } static void enqueue(int x) { if (!isFull()) { System.out.println("Enqueue(" + x + ")"); rear++; queue[rear] = x; return; } System.out.println("Queue is full"); } static int dequeue() { if (!isEmpty()) { front++; return queue[front]; } System.out.println("Queue is empty"); return -1; } } 1 6 0 10 15 0 0 0 10 0 0 12 0 15 15 0 0 0 10 0 0 12 0 0 2 1 0 0 10 2 0 5 0 15 0 1 5 0 1 package STPTraining; 2 3 import java.util.Scanner; 4 5 public class EarningBiggestPrizeMoney2_ThamLamSolution { 6 static Scanner scanner = new Scanner(System.in); 7 static int numExchange, size, max, tg, index; 8 static int[] num, counting; 9 static boolean hasSameNumber; 10 public static void main(String[] args) { 11 int testcase = scanner.nextInt(); 12 String temp; 13 for (int test = 1; test <= testcase; test++) { 14 hasSameNumber = false; 15 temp = scanner.next(); 16 numExchange = scanner.nextInt(); 17 size = temp.length(); 18 num = new int[size]; 19 counting = new int[10]; 20 21 for (int i = 0; i < num.length; i++) { 22 num[i] = Character.getNumericValue(temp.charAt(i)); 23 counting[num[i]]++; 24 if (counting[num[i]] == 2) { 25 hasSameNumber = true; 26 } 27 } 28 for (int i = 0; i < size; i++) { 29 index = max = -1; 30 for (int j = i + 1; j < size; j++) { 31 if (num[j] > max && num[j] > num[i] ) { 32 max = num[j]; 33 index = j; 34 } 35 } 36 if (max != -1) { 37 tg = num[i]; 38 num[i] = num[index]; 39 num[index] = tg; 40 numExchange--; 41 if (numExchange == 0) { 42 break; 43 } 44 } 45 } 46 47 if (numExchange % 2 == 0 || hasSameNumber) { 48 49 }else { 50 tg = num[size - 2]; 51 num[size - 2] = num[size - 1]; 52 num[size - 1] = tg; 53 } 54 temp = ""; 55 for (int i = 0; i < num.length; i++) { 56 temp += num[i]; 57 } 58 System.out.println("Case #" + test); 59 System.out.println(Integer.parseInt(temp)); 60 // System.out.println("Remain: " + numExchange); 61 System.out.println(); 62 } 63 scanner.close(); 64 } 65 66 } 67

Các lần nộp bài đã được ghi nhân
(Xem dạng tệp tin văn bản)

Problems

Danh sách các bài đã làm đạt yêu cầu:

NKBUS

Danh sách các bài làm chưa đạt yêu cầu:

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.