TC SRM 521 (div. 2) 1000'

  比赛时候没搞出来,在赛后好像只能提交不能评测不知道为什么,故我也不知道自己搞得对不对。不过这道题让我会用了map(看了同一房间里面的一个大牛的代码后,而且这个大牛是个中学生好像……)。

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
class SquaredSubsets
{
public:
long long countSubsets(int n, vector <int> x, vector <int> y)
{
	int s = x.size(), h = 0, v = 0;
	long x0[551], y0[551];
	map <long long, bool> mymap;
	long long sum = 0;

	n <<= 1;
	for(int i = 0; i < s; i++)
	{
		x[i] <<= 1;
		y[i] <<= 1;
		x0[++h] = x[i];
		x0[++h] = x[i] - 1;
		x0[++h] = x[i] + n + 1;
		y0[++v] = y[i];
		y0[++v] = y[i] - 1;
		y0[++v] = y[i] + n + 1;
	}
	mymap[0] = 1;
	for(int i = 1; i <= h; i++)
		for(int j = 1; j <= h; j++)
		{
			long long SC = 0;

			for(int k = 0; k < s; k++)
				if(x[k] >= x0[i] - n && x[k] <= x0[i] && y[k] >= y0[j] - n && y[k] <= y0[j])
					SC |= 1 << k;
			if(!mymap.count(SC))
			{
				sum++;
				mymap[SC] = 1;
			}
		}

	return sum;
}
};

转载于:https://www.cnblogs.com/zxfx100/archive/2011/10/14/2212592.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
org.csource.common.MyException: getStoreStorage fail, errno code: 2 at org.csource.fastdfs.StorageClient.newReadableStorageConnection(StorageClient.java:1767) at org.csource.fastdfs.StorageClient.download_file(StorageClient.java:1219) at org.csource.fastdfs.StorageClient.download_file(StorageClient.java:1206) at com.wzdigit.framework.utils.FastDFSUtil.downFile(FastDFSUtil.java:209) at com.wzdigit.srm.dsr.utils.FileUtil.getSingleFile(FileUtil.java:51) at com.wzdigit.srm.dsr.service.bidding.BiddingorderService.getVendorQuotation(BiddingorderService.java:796) at com.wzdigit.srm.dsr.service.bidding.BiddingorderService.sendEmail(BiddingorderService.java:746) at com.wzdigit.srm.dsr.service.bidding.BiddingorderService$$FastClassBySpringCGLIB$$ebfcbd5a.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) at com.wzdigit.srm.dsr.service.bidding.BiddingorderService$$EnhancerBySpringCGLIB$$80ace30.sendEmail(<generated>) at com.wzdigit.srm.dsr.service.bidding.BiddingorderService$$FastClassBySpringCGLIB$$ebfcbd5a.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值