- 八
- 2014-09-10 18:38:17 @
如题
5 条评论
-
chensy98 LV 10 @ 2014-09-29 20:48:11
经计算似乎还真是八位一存啊。
-
2014-09-25 22:10:04@
你是想说8位吗
-
2014-09-16 16:01:18@
使用bitset或者vector<bool>,可以8个位占一个字节
-
2014-09-10 20:37:26@
1000000000B=953.67431640625MB
-
2014-09-10 18:39:38@
记录信息
评测状态 Memory Limit Exceeded
题目 P1629 八
递交时间 2014-09-08 15:23:18
代码语言 C++
评测机 VijosEx
消耗时间 0 ms
消耗内存 977104 KiB
评测时间 2014-09-08 15:23:24
评测结果编译成功
测试数据 #0: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #1: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #2: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #3: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #4: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #5: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #6: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #7: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #8: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
测试数据 #9: MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
MemoryLimitExceeded, time = 0 ms, mem = 977104 KiB, score = 0
代码#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>using namespace std;
bool x[1000000000 + 10];
int y[15 + 2];
int i , j;
int a , b;
int n;
long long sum;int main()
{
while( cin >> n )
{
sum = 0;
memset( y , 0 , sizeof( y ) );
for( i = 0 ; i < n ; i++ )
scanf( "%d" , &y[i] );scanf( "%d %d" , &a , &b );
for( i = 0 ; i < n ; i++ )
{
if( a % y[i] == 0 )
j = a / y[i];
else
j = ( ( a / y[i] ) + 1 ) * y[i];
for( ; j <= b ; j += y[i] )
x[j] = 1;
}
if( a % 8 == 0 )
i = a / 8;
else
i = ( ( a / 8 ) + 1 ) * 8;
for( ; i <= b ; i += 8 )
if( x[i] == 0 )
sum++;
cout << sum << endl;
memset( x , 0 , sizeof( x ) );
}
return 0;
}居然MLE?内存只用大概120MB呀。。。
- 1