TOYS】的更多相关文章

http://poj.org/problem?id=2318 第一次完全是$O(n^2)$的暴力为什么被卡了-QAQ(一定是常数太大了...) 后来排序了下点然后单调搞了搞..(然而还是可以随便造出让我的code变成$O(n^2)$的23333) #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include…
http://poj.org/problem?id=2318 TOYS Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 10178   Accepted: 4880 Description Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child…
TOYS Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8661   Accepted: 4114 Description Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away wh…
2318 TOYS 2398 Toy Storage 题意 : 给你n块板的坐标,m个玩具的具体坐标,2318中板是有序的,而2398无序需要自己排序,2318要求输出的是每个区间内的玩具数,而2318要求输出的是有 i 个玩具的区间有几个. 思路 : 两个题基本差不多,只不过2398排一下序,然后再找个数组标记一下就行. 这个题我一开始没想到用二分,判断了点在四边形内但是没写下去,然后看了网上的二分区间,利用叉积判断点在左边还是右边. 2318代码: #include <stdio.h> #…
TOYS 题意:给定一个如上的长方形箱子,中间有n条线段,将其分为n+1个区域,给定m个玩具的坐标,统计每个区域中的玩具个数. 思路:这道题很水,只是要知道会使用叉乘来表示点在线的上面还是下面: 当a.Xmult(b,c) < 0时,表示在线的上面.之后就是二分的时候,不能直接使用mid来ans[mid]++; 因为只是确定点在这条线的两边,到底是哪一边,具体还要用tmp来判断;(模板题) #include<iostream> #include<cstdio> #includ…
TOYS Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 10281   Accepted: 4924 Description Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away w…
C. Tanya and Toys 题目链接http://codeforces.com/contest/659/problem/C Description In Berland recently a new collection of toys went on sale. This collection consists of 109 types of toys, numbered with integers from 1 to 109. A toy from the new collectio…
Description In Berland recently a new collection of toys went on sale. This collection consists of 109 types of toys, numbered with integers from 1to 109. A toy from the new collection of the i-th type costs i bourles. Tania has managed to collect n …
Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectangular box to put his toys in, but John i…
TOYS Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 14433   Accepted: 6998 Description Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away w…