- 博客(9)
- 收藏
- 关注
原创 Large Division
Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only if there exists an integer c such that a = b * c.InputInput starts with an integer T (≤ 525), denoting th
2021-04-06 15:10:48 92
原创 Aizu - ALDS1_2_A Bubble Sort
Bubble SortWrite a program of the Bubble Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:BubbleSort(A)1 for i = 0 to A.length-12 for j = A.length-1 downto i+13 if A[j] &
2021-03-24 21:39:10 100
原创 Aizu - ALDS1_2_C Stable Sort
Stable SortLet’s arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, … 9). For example, ‘eight of heart’ is represented by H8 and ‘one of diamonds’ is represented by D1.Your task is to write a program which sort
2021-03-24 21:26:19 142
原创 Aizu - ALDS1_2_BSelection Sort
Selection SortWrite a program of the Selection Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:SelectionSort(A)1 for i = 0 to A.length-12 mini = i3 for j = i to A.length-14
2021-03-24 11:54:36 183
原创 Aizu - ALDS1_1_A Insertion Sort
Aizu - ALDS1_1_A Insertion SortWrite a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:for i = 1 to A.length-1key = A[i]/* insert A[i] into the sorted sequen
2021-03-23 19:18:52 89
原创 ALDS 1_1_D:Maximum Profit
ALDS 1_1_D:Maximum ProfitYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.Wr
2021-03-23 19:15:42 117
原创 【并查集】A-Wireless Network
问题An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the network were all broken. The computers are repaired on
2020-11-20 17:22:05 119
原创 【并查集】C-How Many Tables
问题:Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends do not want to stay with stranger
2020-11-20 17:16:46 96
原创 回文数的判断
在这里插入代码片```#include<stdio.h>int main(){ int n,i; scanf("%d",&n); for(i=1;i<=n;i++) { int a=i,b=0; while(a>0) {b=b*10+a%10; a/=10;...
2020-02-26 23:37:50 288
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人