2746 - I2P(II) 2023_Kuo_Lab0 Scoreboard

Time

2023/02/21 13:20:00 2023/02/21 15:10:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
10947 delete linked list
12602 OuQ String
12613 Yet Another Meme Problem

10947 - delete linked list   

Description

This problem will give you a sequence of positive integers.  Use this sequence to create a linked list to store those integers.  Next, the problem will give you another sequence of positive integers, p0, p1,…pk-1.  Delete the nodes in the position at p0, p1, …pk-1 of the linked list, where 1<=p0<p1<…pk-1<=N. If the node is not existing,do nothing. And show the final results.

For example, if the first sequence is 1, 2, 3, 4, 5, 6,7, a linked list is created as

If the second sequence is 1, 1, 4, do the follows.

After p1=1, the list becomes

because the first node is 1.  After p2 = 1, the list becomes

because the first node is 2.  After p3 = 4, the list becomes

because the fourth node is 6.

 

The framework of the program is provided.

  1. Create a linked list from the input  (createList)
  2. while there are still some data pi
  3.     read in pi 
  4.     delete node at pi  (deleteNode)
  5. print the remaining list (printList)
  6. free the list (freeList)

You will be provided with main.c and function.h. main.c contains the implementation of function printList, and freeList, and function.h contains the definition of node and the interface of createList(&head) and deleteNode(&head, pi).  You only need to implement createList(&head) and deleteNode(&head, pi) in function.c, in which head is the head of the linked list, and pi is the node at pi to be deleted.

 

You will be provided with main.c and function.h, and asked to implement function.c.

For OJ submission:

       Step 1. Submit only your function.c into the submission block. (Please choose c compiler) 

       Step 2. Check the results and debug your program if necessary.

main.c

function.h

Input

The input contains 2 sequence of positive integers as the linklist and the order, except the last one, which is -1, indicating the end of the sequence. 

Output

The output contains the sequence of resulting linklist.

Sample Input  Download

Sample Output  Download

Partial Judge Code

10947.c

Partial Judge Header

10947.h

Tags

10502HW1 10402HW 105那個分錯類了... hard



Discuss




12602 - OuQ String   

Description

Define the level 1 string s1 = “OuQ”,
and the level k string sk = “O” + sk1 + “u” + sk1 + “Q”.

For example:

  • s2 = “O” + s1 + “u” + s1 + “Q” = “OOuQuOuQQ”
  • s3 = “OOOuQuOuQQuOOuQuOuQQQ”

Given 3 integeres k,l,r.
Please find all characters of sk[l],sk[l+1],...sk[r1],sk[r]

Input

There’re multiple testcases in input.
Three integers k,l,r on each line.

  • ≤ ≤ 50
  • ≤ ≤ length of sk
  • ≤ |rl+1≤ 100

Output

For each testcase, print |rl+1| characters,sk[l],sk[l+1],...sk[r1],sk[r], for a line.

Remember ‘\n’ on the end of each line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




12613 - Yet Another Meme Problem   

Description

Problem slightly modified from codeforces educational round 80

meme

You are given two integers A and B, calculate the number of pairs (a,b) such that 1≤aA, 1≤bB, and the equation a⋅b+a+b=conc(a,b) is true.

conc(a,b) is the concatenation of a and b (for example, conc(12,23)=1223, conc(100,11)=10011). a and b should not contain leading zeroes.

Hints

  1. For the first test case in sample input, there is only one suitable pair : a=1, b=9 (1+9+1⋅9=19).

  2. Since the number is large in this problem, it is suggested to use long long int.

 

Input

The first line contains t (1≤t≤100) — the number of test cases.

Each test case contains two integers A and B (1≤A, b≤10^9).

Output

Print one integer — the number of pairs (a,b) such that 1≤aA, 1≤bB, and the equation a⋅b+a+b=conc(a,b) is true.

Sample Input  Download

Sample Output  Download

Tags




Discuss