2009年8月28日 星期五

2009年8月26日 星期三

Opera 10.0 Release Candidate

據說速度加速了40%

實際上與9.64版的比較感覺真的快超多 XD

而且會將上次瀏覽的網頁與現在新開的頁面做區隔!

多國語言版下載

以下是更動部分↓

Changelog:

User Interface:
New application icon(感覺以前的比較好看)
Fixed the new tab button on the sides(ctrl+tab間隔變大了,比較清楚)
Various small Visual Tabs fixes(以下我都不知道是殺毀= =")
Fixed a BitTorrent crash
Fix to jumping up/down of the new tab button while on the sides
Fixed Bug DSK-195906 (Opera error page selects URL field when displayed, also when focus is already inside URL field)
Fixed Bug DSK-257578 ("..." in site titles in some cases overlap the close button)
Fixed Bug DSK-258585 (Can't remove menu button when main menu is disabled): The menu button can be removed as any other toolbar button now (upgraders may have to reset the toolbar first)
Fixed Bug DSK-261205 (Strings don't fit in Preferences > Downloads [pl])
Fixed Bug DSK-261206 (Strings don't fit in Preferences > Programs [pl])
Fixed Bug DSK-261757 (Missing "splitter" in bookmark split view)
Fixed Bug DSK-261933 (Text cut off in startup dialog (Polish translation))
Fixed Bug DSK-261962 ("Reset Toolbar to Its Default" resets all toolbars, not just the current)
Fixed Bug DSK-262181 (Empty [dropdown widget] section added to custom shortcuts by update)
Fixed Bug DSK-262283 (Skin.ini section inconsistencies)

Core
Various crash fixes
Fixed Bug CORE-19376 (Crash navigating history)
Fixed Bug CORE-23125 (Adding IFRAME with javascript: src through DOM adds history entry (Yandex))

Opera Mail:
Fixed a crash
Fixed Bug DSK-245600 (Mail imported into account with no downloading of message bodies loses bodies)
Fixed Bug DSK-261035 (Crash when opening image attachments)
Fixed Bug DSK-261459 (Go to Unread View when requested, don't reuse a maximized mail view)

Windows
Crash Fix
Reverted Fix to Bug DSK-241262 (Error message when opening HTML files if Opera is not already running): This caused DSK-262363
Fixed Bug DSK-259756 (Installer removes icon pinned to the Windows 7 task bar)
Fixed Bug DSK-260498 (The list of closed tabs needs clicks to be shown)
Fixed Bug DSK-262363 (Other programs using the http protocol to open websites in Opera just open blank page in Windows Vista and Windows 7)
Fixed Bug DSK-259743 (Closed tabs and new tab buttons have non-native looks in native skin)
Fixed Bug DSK-262120 (Panel selector buttons in Native skin get Standard style when not on the left)
Fixed Bug DSK-262272 (Closed tabs and new tab positioned incorrectly when tabbar is placed on left or right side)

Mac
Fixed Bug DSK-261726 (Closed Tabs button overlaps tabs when set to right or left and new tab button is disabled)

Unix
Fixed Bug DSK-259575 (Dead keys don't seem to work on widgets)
Fixed Bug DSK-250495 (Spell checking not working for some UNIX users)

2009年8月22日 星期六

10000 - Longest Paths

Time limit: 3.000 seconds
                                      Longest Paths
It is a well known fact that some people do not have their social abilities completely enabled. One example is the lack of talent for calculating distances and intervals of time. This causes some people to always choose the longest way to go from one place to another, with the consequence that they are late to whatever appointments they have, including weddings and programming contests. This can be highly annoying for their friends.
César has this kind of problem. When he has to go from one point to another he realizes that he has to visit many people, and thus always chooses the longest path. One of César's friends, Felipe, has understood the nature of the problem. Felipe thinks that with the help of a computer he might be able to calculate the time that César is going to need to arrive to his destination. That way he could spend his time in something more enjoyable than waiting for César.

Your goal is to help Felipe developing a program that computes the length of the longest path that can be constructed in a given graph from a given starting point (César's residence). You can assume that the graph has no cycles (there is no path from any node to itself), so César will reach his destination in a finite time. In the same line of reasoning, nodes are not considered directly connected to themselves.
Input
The input consists of a number of cases. The first line on each case contains a positive number n ( ) that specifies the number of points that César might visit (i.e., the number of nodes in the graph).
A value of n = 0 indicates the end of the input.

After this, a second number s is provided, indicating the starting point in César's journey ( ). Then, you are given a list of pairs of places p and q, one pair per line, with the places on each line separated by white-space. The pair `` " indicates that César can visit q after p.
A pair of zeros (``0 0") indicates the end of the case.

As mentioned before, you can assume that the graphs provided will not be cyclic.
Output
For each test case you have to find the length of the longest path that begins at the starting place. You also have to print the number of the final place of such longest path. If there are several paths of maximum length, print the final place with smallest number.

Print a new line after each test case.

Sample Input
2
1
1 2
0 0
5
3
1 2
3 5
3 1
2 4
4 5
0 0
5
5
5 1
5 2
5 3
5 4
4 1
4 2
0 0
0

Sample Output
Case 1: The longest path from 1 has length 1, finishing at 2.

Case 2: The longest path from 3 has length 4, finishing at 5.

Case 3: The longest path from 5 has length 2, finishing at 1.

=====================================================

#include <stdio.h>
#include <stdlib.h>

// function prototype
void DFS(int data_num, int from, int step);

// data structure
struct FromTo
{
 int p;
 int q;
};

struct FromTo FromTo[100];
int longest_path;
int finish_point;

int main()
{
 freopen("Input.txt", "r", stdin);
 freopen("Output.txt", "w", stdout);
   
 int start_point;
 int point_num;
 int p, q;
 int case_num = 1;
   
 while(1)
 {  
  int data_num = 0;
  scanf("%d", &point_num);
  if(!point_num)
   break;
  for(int i=0; i<100; i++)
   FromTo[i].p = FromTo[i].q = -1;
  scanf("%d", &start_point);
  for(int i=0; scanf("%d %d", &p, &q) == 2; i++)
  {
   if(!p && !q)
    break;
   FromTo[i].p = p;
   FromTo[i].q = q;
   data_num++;
  }
  longest_path = 0;
  DFS(data_num, start_point, 0);
   
  printf("Case %d: The longest path from %d has length %d, finishing at %d.\n\n",
      case_num++, start_point, longest_path, finish_point);
 }
   
 return 0;
}

void DFS(int data_num, int from, int step)
{
 for(int i=0; i<data_num; i++)
  if(FromTo[i].p == from)
  {
   if(++step > longest_path)
   {
    longest_path = step;
    finish_point = FromTo[i].q;
   }
   DFS(data_num, FromTo[i].q, step);
   --step;
  }
}