Home > Back-end >  Turn to the great god ~ no problem in their own compiler runs, in oj show operation error
Turn to the great god ~ no problem in their own compiler runs, in oj show operation error

Time:09-19

Title description


Small K is a sea port customs personnel, every day there are many ships reached the port, the ship usually have a lot of passengers from different countries,

Small K to reach port of ship was very interested in these, he shall, in accordance with the time recorded every ship arrived in harbour; To the ship arrived, I recorded the time of the ship arrived at ti (unit: second), the number of passenger on board star ki, and each passengers the nationality of the x (I, 1), x (I, 2),... , x (I, k); ,

Small K n the statistical information of ship, hope you help calculate to each ship end 24 hours of arrival time (24 hours=86400 seconds) all passenger boat arrived from many different countries,

Formally, you need to calculate n pieces of information, the output of the message, I you need statistics to meet ti - 86400 & lt; Tp & lt;=ti ships p, of all the x (p, j), a total of how many different Numbers,

Input format:

The first line, enter a positive integer n, said krystkowiak statistical information of n ship,

The next n lines, each describing a ship information: in the first two integer ti and ki respectively the ship reached port of time and the number of passengers on board, the next ki integers x (I, j) said the passengers on board the ship 7,

Ensure input ti is increasing, the unit is seconds; Said from K timing starts to work for the first time, the ship reached port in the first ti seconds,

Guarantee,,,,

Which represent all ki and,

The output format:

Output n lines, the line output an integer I said the ship arrived I statistics,
The following code
#include
Int n, t [11000], [11000], k=0, a x [11000] [33000], s=0, y [11000], c;
Int main () {
The scanf (" % d ", & amp; n);
for(int i=1; i<=n; + + I) {
The scanf (" % d % d ", & amp; [I] t, & amp; K [I]);
For (int j=1; J<[I]=k; + + j) the scanf (" % d ", & amp; [I] x [j]);
}
for(int i=1; i<=n; + + I) {
For (int j=I; T [j] & gt; [I] t - 86400; - j) {
For (int l=1; L<[j]=k; + + l) {
For (int u=1; U<=a; + + u) if (x [j] [l]! [u]=y) + + s;
If (s==a) y=x [+ + a] [j] [l];
S=0;
}
}
printf("%d\n",a);
A=0;
}
return 0;
}
  • Related