记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Wrong Answer 5ms 444.0 KiB
#2 Wrong Answer 5ms 436.0 KiB
#3 Time Exceeded ≥1000ms ≥1.168 MiB
#4 Time Exceeded ≥1001ms ≥1.164 MiB
#5 Time Exceeded ≥1001ms ≥1.168 MiB
#6 Time Exceeded ≥1000ms ≥1.164 MiB
#7 Time Exceeded ≥1002ms ≥1.164 MiB
#8 Time Exceeded ≥1001ms ≥1.172 MiB
#9 Time Exceeded ≥1000ms ≥1.176 MiB
#10 Time Exceeded ≥1002ms ≥1.172 MiB

代码

#include <iostream>
#include <vector>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    vector<int> xor_values(N);
    for (int i = 0; i < N; i++) {
        xor_values[i] = a[i];
        for (int j = 0; j < i; j++) {
            if ((a[i] & a[j]) > (a[i] ^ a[j])) {
                xor_values[i]++;
            }
        }
    }
    int count = 0;
    for (int i = 0; i < N; i++) {
        count += xor_values[i];
    }
    cout << count << endl;
    return 0;}

信息

递交者
类型
递交
题目
P1002 统计
语言
C++
递交时间
2024-09-10 19:24:36
评测时间
2024-09-10 19:24:36
评测机
分数
0
总耗时
≥8022ms
峰值内存
≥1.176 MiB