hdu 1701 ACMer

ACMer

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5164    Accepted Submission(s): 2449


Problem Description
There are at least P% and at most Q% students of HDU are ACMers, now I want to know how many students HDU have at least?
 

Input
The input contains multiple test cases.
The first line has one integer,represent the number of test cases.
The following N lines each line contains two numbers P and Q(P < Q),which accurate up to 2 decimal places.
 

Output
For each test case, output the minumal number of students in HDU.
 

Sample Input
  
  
1 13.00 14.10
 

Sample Output
  
  
15
 

Source

//#include"stdafx.h"
#include<stdio.h>
#include<algorithm>
using namespace std;
#define  size 1010

int main() {
    int test;
    float a, b;
    scanf_s("%d", &test);
    for (int i = 1; i <= test; i++) {
        scanf_s("%f%f", &a, &b);
        float minn = 1;
        while (true){
            int c = (int)(minn*a / 100);
            int d = (int)(minn*b / 100);
            if (d - c == 1)
                break;
            minn++;
        }
        printf_s("%d\n", (int)minn);
    }
}


目前提供的引用内容并未涉及20253GESP 5级考试的具体题与解。然而,可以推测该级别的考试可能涵盖了更高级别的编程概念和技术细节,例如但不限于算法设计、复杂的数据结构应用以及面向对象编程的核心原理。 以下是基于现有知识体系对于此类考试可能覆盖的内容范围及其解答方式的一个假设性分: ### 可能的考点一:动态规划 #### 题目示例: 给定一个数组 `arr` 和目标值 `target`,求是否存在子使得其和等于 `target`。 ```cpp bool canPartition(vector<int>& nums, int target) { vector<bool> dp(target + 1, false); dp[0] = true; for(auto num : nums){ for(int j=target; j>=num; --j){ dp[j] |= dp[j-num]; } } return dp[target]; } ``` 此代码片段展示了如何利用布尔类型的动态规划表来解决特定条件下的合划分问题[^自定义]. ### 可能的考点二:图论基础 #### 题目示例: 实现广度优先搜索(BFS),用于在一个无向图中找到最短路径长度。 ```cpp int shortestPathLength(vector<vector<int>>& graph, int start, int end){ queue<pair<int,int>> q; vector<bool> visited(graph.size(),false); q.push({start,0}); while(!q.empty()){ auto [node,dist]=q.front();q.pop(); if(node==end)return dist; if(visited[node])continue; visited[node]=true; for(auto neighbor:graph[node]){ if(!visited[neighbor]) q.push({neighbor,dist+1}); } } return -1;//如果无法到达终点返回-1表示不可达 } ``` 上述函数通过队列实现了标准的BFS逻辑,在探索过程中记录节点访问状态并更新距离信息[^自定义]. ### § 1. 动态规划中的状态转移方程是如何构建的? 2. 广度优先搜索相较于深度优先搜索有哪些优势和劣势? 3. 如何优化大规模稀疏矩阵上的图遍历操作效率? 4. 在实际开发场景下,我们通常会选择哪些库或者框架辅助完成复杂的算法模型搭建工作? 5. 如果遇到内存限制条件下处理超大尺寸数据的情况,应该采取何种策略调整程序运行模式以适应资源约束环境?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值