ACM
xiaonuolen
这个作者很懒,什么都没留下…
展开
-
喷水装置(一)(贪心)
喷水装置(一)时间限制:3000 ms | 内存限制:65535 KB难度:3描述现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为Ri的喷水装置,每个喷水装置的效果都会让以它为中心的半径为实数Ri(0<Ri<15)的圆被湿润,这有充足的喷水装置i(1<i<600)个,并且一定能把草坪全部湿润,你要做的是:选择尽量少的喷水装置,把整个草坪的全部...原创 2018-05-21 10:05:08 · 1383 阅读 · 0 评论 -
Two Sum (简单题目)
class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { map<int,int> index;//记录下标 vector<int> res; for(int i=0;i<nums.s...原创 2018-11-16 20:11:31 · 122 阅读 · 0 评论 -
leetcode 2. Add Two Numbers
涉及大数运算 所以考虑用数组来弄 感受到了自己c++的链表不熟练 之前hdu1002用数组就过了 这次刷的题目补充了很多链表的操作知识,特别是链表的初始化操作这块不熟悉 请各位大佬指教 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next;...原创 2018-11-17 15:00:01 · 86 阅读 · 0 评论 -
算法提高 排列数(next_permutation函数练习)
#include <stdio.h>#include <algorithm>using namespace std;int main(){ int num[10]={0,1,2,3,4,5,6,7,8,9}; //sort(num,num+10);因为这里输入的数组本来就是排序好的 所以这里不需要再排序一次了 long long n=0; ...原创 2018-11-26 22:30:12 · 136 阅读 · 0 评论 -
蚂蚁感冒———蓝桥杯校内赛()
历届试题 蚂蚁感冒 时间限制:1.0s 内存限制:256.0MB 问题描述 长100厘米的细长直杆子上有n只蚂蚁。它们的头有的朝左,有的朝右。 每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/秒。 当两只蚂蚁碰面时,它们会同时掉头往相反的方向爬行。 这些蚂蚁中,有1只蚂蚁感冒了。并且在和其它蚂蚁碰面时,会把感冒传染给碰到的蚂蚁。 请你计算,当所有蚂蚁都爬离...原创 2018-12-02 00:15:43 · 153 阅读 · 0 评论 -
Crusaders Quest zoj 3983(find erase的使用) (暴力破解)
Crusaders QuestTime Limit: 1 Second Memory Limit: 65536 KBCrusaders Quest is an interesting mobile game. A mysterious witch has brought great darkness to the game world, and the only hope for...原创 2018-12-05 20:28:32 · 241 阅读 · 0 评论 -
Basically Speaking 转换进制 C语言 itoa strtol Java语言 Integer.valueOf Integer.toString
Basically SpeakingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4163 Accepted Submission(s): 1691 Problem DescriptionThe Really Nea...原创 2018-12-03 19:23:22 · 145 阅读 · 0 评论 -
Function and Function zoj4070
原题链接http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4070不要用cout输出否则就会超时#include<bits/stdc++.h>using namespace std;int main(){ int T=0; int ea[] = {1,0,0,0,1,0,1,0,2...原创 2018-12-09 19:58:39 · 168 阅读 · 0 评论 -
C++——关于lower_bound( )和upper_bound( )的常见用法
原文链接:https://blog.csdn.net/qq_40160605/article/details/80150252 lower_bound( )和upper_bound( )都是利用二分查找的方法在一个排好序的数组中进行查找的。在从小到大的排序数组中,lower_bound( begin,end,num):从数组的begin位置到end-1位置二分查找第一个大于或等于...转载 2019-01-11 20:49:06 · 9468 阅读 · 2 评论