摘要:
~题目链接~http://poj.org/problem?id=1328输入3 21 2-3 12 11 20 20 0结果Case 1: 2Case 2: 11.小岛上的雷达在X轴上有覆盖区域,左点x-sqrt(d*d-y*y)和 右点x+sqrt(d*d-y*y).2.对左覆盖点就行排序,(区域覆盖问题)。贪心#include#include#include#include#define maxn 1000+10int num=0;struct node{ double l,r;} N[maxn],M;int main(){ int n; double d; whi... 阅读全文
摘要:
~题目链接~http://poj.org/problem?id=2965输入-+-----------+--结果61 11 31 44 14 34 41.BFS+位运算自己写了一半天异或的代码,又长又不实用,提交还TLE(此在代码有 已被注释,如果有大牛可以改出来,希望帮助);后跟人家学了一招,很方便。#include#include#include#include#define maxm 65535+10#define maxn 4using namespace std;int ID[30] = {4383,8751,17487,34959,4593,8946,17652,35064,795 阅读全文
摘要:
~题目链接~http://poj.org/problem?id=1753可参考大神题解(位运算):http://www.cnblogs.com/tanhehe/archive/2013/06/11/3131615.html http://www.cnblogs.com/kuangbin/archive/2011/07/30/2121677.html http://poj.org/showmessage?message_id=340320输入bwwbbbwbbwwbbwww结果4位运算+队列 知识点: ^ 异或,1^1=0,1^0=... 阅读全文
摘要:
~题目连接~http://poj.org/problem?id=1013输入1 ABCD EFGH even ABCI EFJK up ABIJ EFGH even 结果K is the counterfeit coin and it is light. even 都为真,标记(为保持好看,标记写成了累加,最后判断是否为0)up右重左轻,分类累加down右轻左重,分类累加k 记录假币出现次数最后判断未被标记,且与假币出现次数相等的数据(若出现多枚假币,只能说明输入数据错误……^_^……)#include#include#include#define maxn 30struct node{ .. 阅读全文
摘要:
~题目链接~http://poj.org/problem?id=1008&lang=default&change=true输入310. zac 00. pop 010. zac 1995结果33 chuen 01 imix 09 cimi 2801注意处理临界点4. uayet 259正解是 13 ahau 364而不是13 ahau 365#include#include#includechar Haab[19][10]= {"pop","no","zip","zotz","tzec&q 阅读全文