Arrangement of lines

1. 定义:A(L)是由顶点/边/面组成的细分平面

2. max vertices=n(n-1)/2

max edges = n^2

 max faces =1+\frac{n^{2}}{2}+\frac{n}{2}

增量算法:

①计算交点,时间复杂度O(n^{2})

②添加新线

延新线从左到右走,通过边e 进入face,next指针指向出边e'

找到e'的邻接面,继续....

如果从existing vertex v离开,寻找v附近的面直到找到l穿过的下一个面

总步骤:

Exercise:

Consider the face f where the new line leaves through a vertex. Describe the finding of the face adjacent to f.

查找包含当前vertex的face,判断该face和li是否会相交。

C - Giant Domino Editorial  /   Time Limit: 2 sec / Memory Limit: 1024 MiB Score : 300 points Problem Statement There are 𝑁 dominoes numbered from 1 to 𝑁 . The size of domino 𝑖 is 𝑆 𝑖 . Consider arranging some dominoes in a line from left to right and then toppling them. When domino 𝑖 falls to the right, if the size of the domino placed immediately to the right of domino 𝑖 is at most 2 𝑆 𝑖 , then that domino also falls to the right. You decided to choose two or more dominoes and arrange them in a line from left to right. The arrangement of dominoes must satisfy the following conditions: • The leftmost domino is domino 1 . • The rightmost domino is domino 𝑁 . • When only domino 1 is toppled to the right, domino 𝑁 eventually falls to the right as well. Does an arrangement of dominoes satisfying the conditions exist? If it exists, what is the minimum number of dominoes that need to be arranged? You are given 𝑇 test cases, solve the problem for each of them. Constraints • 1 ≤ 𝑇 ≤ 1 0 5 • 2 ≤ 𝑁 ≤ 2 × 1 0 5 • 1 ≤ 𝑆 𝑖 ≤ 1 0 9 • The sum of 𝑁 over all test cases is at most 2 × 1 0 5 . • All input values are integers.  Input The input is given from Standard Input in the following format, where c a s e 𝑖 means the 𝑖 -th test case: 𝑇 c a s e 1 c a s e 2 ⋮  c a s e 𝑇 Each test case is given in the following format: 𝑁 𝑆 1 𝑆 2 … 𝑆 𝑁 Output Output 𝑇 lines. The 𝑖 -th line should contain the answer for the 𝑖 -th test case. For each test case, if there is no arrangement of dominoes satisfying the conditions, output -1; otherwise, output the minimum number of dominoes to arrange.  Sample Input 1Copy Copy 3 4 1 3 2 5 2 1 100 10 298077099 766294630 440423914 59187620 725560241 585990757 965580536 623321126 550925214 917827435 Sample Output 1Copy Copy 4 -1 3 For the 1 st test case, arranging the dominoes from left to right in the order domino 1 , domino 3 , domino 2 , domino 4 satisfies the conditions in the pr
11-20
Problem: Energy Modeling and Structural Analysis of Gold Clusters Metal clusters, especially gold (Au) clusters, are tiny groups of atoms with unique properties that depend on their size and arrangement. They are neither single atoms nor bulk materials, and their behavior is influenced by special quantum effects. Even clusters with the same number of atoms can have very different 3D shapes (called configurations or isomers). Each shape has a specific energy, and usually, the one with the lowest energy is the most stable. Figure 1 shows several examples of Au₂₀ (20-atom gold) clusters with different shapes. Figure 1. Illustrative representations of various isomeric configurations of the Au₂₀ cluster. One accurate way to calculate these energies is Density Functional Theory (DFT). However, DFT calculations take a lot of computer time, especially for larger clusters. That’s why researchers are interested in building faster models—such as mathematical formulas or machine learning models— that can predict the energy of a cluster directly from its atomic coordinates. To accomplish this task, you will work with a dataset containing 1000 Au₂₀ clusters in .xyz format.  First line – Number of atoms (e.g., 20)  Second line – Total energy of the structure (a single number)  Remaining lines – The (x, y, z) coordinates of each atom You can open .xyz files with a text editor or view them in molecular visualization software like Visual Molecular Dynamics (VMD). Tasks Task 1: Predicting Energies of Au₂₀ Clusters You are provided with a dataset containing the three-dimensional coordinates and corresponding total energies of 999 Au₂₀ (gold-20) cluster structures.  Develop a mathematical or machine learning-based model to predict the energy of Au₂₀ clusters from their atomic coordinates.  Use Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and R² score to evaluate the prediction accuracy of your model. Task 2: Finding and Describing the Most Stable Structures Using the same dataset of 999 Au₂₀ clusters:  Analyze the statistical distribution of total energies, including key metrics such as the mean, variance, and skewness.  Identify and visualize the one of the lowest-energy structures.  Summarize common geometrical features of low-energy configurations Task 3: Sensitivity Analysis via Local Structural Perturbation Using the identified representative lowest-energy Au₂₀ cluster structure in Task 2:  Apply the local perturbations (e.g., random displacements of a few atomic positions) to generate a set of new configurations (slightly “distorted” versions).  Quantify the relationship between perturbation magnitude and corresponding changes in total energy.  Use your model in Task 1 to predict the energies of these new versions, and report the changes in predicted energy using MAE and RMSE relative to the original structure.  Propose a structural stability variable to investigate the robustness of atomic configuration to perturbations. 我们没学过请你一步一步以最基础的部分分析题目并且完成
09-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值