Problem 1. Empty Stalls

  扫两遍即可。

Problem 2. Line of Sight

  我们发现能互相看见的一对点一定能同时看见粮仓的某一段。于是转换成有n段线段,问有多少对线段相交。可以按左端点排序,用优先队列维护右端点,弹出比左端点小的。

  为了方便计算对数,我们可以先做一遍,再把每个线段都+2*pi,再计数。

Problem 3. No Change

  (没有看到要买的东西必须是依次的。。)

  如果要依次买的话就显然可以用dp搞。

USACO 2013 November Contest Gold 简要题解的更多相关文章

  1. Comet OJ - Contest #2 简要题解

    Comet OJ - Contest #2 简要题解 cometoj A 模拟,复杂度是对数级的. code B 易知\(p\in[l,r]\),且最终的利润关于\(p\)的表达式为\(\frac{( ...

  2. Comet OJ - Contest #2简要题解

    Comet OJ - Contest #2简要题解 前言: 我没有小裙子,我太菜了. A 因自过去而至的残响起舞 https://www.cometoj.com/contest/37/problem/ ...

  3. 300iq Contest 1 简要题解

    300iq Contest 1 简要题解 咕咕咕 codeforces A. Angle Beats description 有一张\(n\times m\)的方阵,每个位置上标有*,+,.中的一种. ...

  4. Comet OJ - Contest #5 简要题解

    好久没更博了,还是象征性地更一次. 依然延续了简要题解的风格. 题目链接 https://cometoj.com/contest/46 题解 A. 迫真字符串 记 \(s_i\) 表示数字 \(i\) ...

  5. USACO 2015 December Contest, Gold Problem 2. Fruit Feast

    Problem 2. Fruit Feast 很简单的智商题(因为碰巧脑出来了所以简单一,一 原题: Bessie has broken into Farmer John's house again! ...

  6. AtCoder Grand Contest 031 简要题解

    AtCoder Grand Contest 031 Atcoder A - Colorful Subsequence description 求\(s\)中本质不同子序列的个数模\(10^9+7\). ...

  7. USACO 2016 February Contest, Gold解题报告

    1.Circular Barn   http://www.usaco.org/index.php?page=viewproblem2&cpid=621 贪心 #include <cstd ...

  8. USACO 2016 January Contest, Gold解题报告

    1.Angry Cows http://www.usaco.org/index.php?page=viewproblem2&cpid=597 dp题+vector数组运用 将从左向右与从右向左 ...

  9. AtCoder Grand Contest 039 简要题解

    从这里开始 比赛目录 Problem A Connection and Disconnection 简单讨论即可. Code #include <bits/stdc++.h> using ...

随机推荐

  1. Unity 教程和源码

    12个Unity3D游戏源码 -  新手必备 愤怒的小鸟攻略技巧秘籍 NGUI 教程收录大全:http://forum.exceedu.com/forum/forum.php?mod=viewthre ...

  2. 【Todo】抽象渗漏法则 & 找到理想员工 & 软件开发成功 12 法则 & Joel on Software

    Joel应该是个软件专家,这是他文章汇总的中文版本: http://local.joelonsoftware.com/wiki/Chinese_%28Simplified%29 其中有几篇值得好好看看 ...

  3. 代码实现获取log日志和logcat使用方法

    代码实现获取log日志new Thread(new Runnable() {                        @Override                        publi ...

  4. POJ 2065 SETI (高斯消元 取模)

    题目链接 题意: 输入一个素数p和一个字符串s(只包含小写字母和‘*’),字符串中每个字符对应一个数字,'*'对应0,‘a’对应1,‘b’对应2.... 例如str[] = "abc&quo ...

  5. poj 1703 Find them, Catch them(并查集)

    题目:http://poj.org/problem?id=1703 题意:一个地方有两个帮派, 每个罪犯只属于其中一个帮派,D 后输入的是两个人属于不同的帮派, A后询问 两个人是否属于 同一个帮派. ...

  6. 通过org.springframework.web.filter.CharacterEncodingFilter定义Spring web请求的编码

    通过类org.springframework.web.filter.CharacterEncodingFilter,定义request和response的编码.具体做法是,在web.xml中定义一个F ...

  7. 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn

    TableLayout的行数由开发人员直接指定,即有多少个TableRow对象(或View控件),就有多少行. TableLayout的列数等于含有最多子控件的TableRow的列数.如第一Table ...

  8. php服务器安装memcache

    https://pecl.php.net/get/memcache-3.0.8.tgz wget https://pecl.php.net/get/memcache-3.0.8.tgzgzip -d ...

  9. macro names must be identifiers

    1.错把 #include 写成了 #define 会报这个错 2.定义一个不存在的宏业会报这个错,如加了-DANDRO 而ANDRO不存在

  10. dynamic_cast,const_cast,static_cast,reinterpret_cast 详解

    如果直接指针直接强转,将只能访问虚函数的内容,而不能访问特定类中的特定成员或方法!!!! 强制类型转换运算符:C++有四种强制类型转换符,分别是dynamic_cast,const_cast,stat ...