记录详情

Time Exceeded

/in/foo.c: In function 'main':
/in/foo.c:9:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
     if (a[i] & a[j] > a[i] ^ a[j])
                ~~~~~^~~~~~
/in/foo.c:9:14: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
     if (a[i] & a[j] > a[i] ^ a[j])
         ~~~~~^~~~~~~~~~~~~
# 状态 耗时 内存占用
#1 Wrong Answer 3ms 228.0 KiB
#2 Wrong Answer 3ms 324.0 KiB
#3 Time Exceeded ≥1001ms ≥704.0 KiB
#4 Time Exceeded ≥1001ms ≥652.0 KiB
#5 Time Exceeded ≥1001ms ≥684.0 KiB
#6 Time Exceeded ≥1000ms ≥648.0 KiB
#7 Time Exceeded ≥1004ms ≥684.0 KiB
#8 Time Exceeded ≥1000ms ≥648.0 KiB
#9 Time Exceeded ≥1001ms ≥680.0 KiB
#10 Time Exceeded ≥1000ms ≥656.0 KiB

代码

#include <stdio.h>
int main(void) {
	int n, a[100005], ans = 0;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		 for (int j = 1; j < i; j++)
			 if (a[i] & a[j] > a[i] ^ a[j])
				 ans++;
	printf("%d", ans);
	return 0;
}

信息

递交者
类型
递交
题目
P1002 统计
语言
C
递交时间
2024-08-27 19:32:25
评测时间
2024-08-27 19:32:25
评测机
分数
0
总耗时
≥8017ms
峰值内存
≥704.0 KiB