답안 #1108962

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1108962 2024-11-05T18:02:10 Z Kerim 모자이크 (IOI24_mosaic) C++17
0 / 100
746 ms 95428 KB
#include "bits/stdc++.h"
#define ll long long
#define pb push_back
#define pii pair<int, int>
using namespace std;
const int N = 4e5+5;
int cnt[N];

int wow(int a, int b){
    return (!(a|b)?1:0);
}

vector<ll> mosaic(vector<int> X, vector<int> Y, vector<int> T, vector<int> B, vector<int> L, vector<int> R){
    memset(cnt, -1, sizeof cnt);
    int n = (int)X.size();
    assert(X.front()==Y.front());
    map<pii, int> mp;
    for(int i = 1; i <= n; ++i)
        mp[{1, i}] = X[i-1], mp[{i, 1}] = Y[i-1];
    for(int i = 2; i <= n; ++i)
        for(int j = 2; j <= 3; ++j)
            mp[{i, j}] = wow(mp[{i-1, j}], mp[{i, j-1}]);
    for(int i = 2; i <= 3; ++i)
        for(int j = 2; j <= n; ++j)
            mp[{i, j}] = wow(mp[{i-1, j}], mp[{i, j-1}]);
    int ii = 3;
    for(int jj = 3; jj <= n; ++jj)
        cnt[ii-jj+n] = mp[{ii, jj}];
    vector<ll> ans;
    for(int i = 0; i < (int)L.size(); ++i){
        int x = T[i]+1, y = L[i]+1;
        if(x <= 3 or y <= 3)
            ans.pb(mp[{x, y}]);
        else
            ans.pb(cnt[x-y+n]);
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2040 KB Output is correct
2 Correct 2 ms 1852 KB Output is correct
3 Incorrect 2 ms 1872 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2040 KB Output is correct
2 Correct 2 ms 1852 KB Output is correct
3 Incorrect 2 ms 1872 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 746 ms 93640 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2040 KB Output is correct
2 Correct 2 ms 1852 KB Output is correct
3 Incorrect 2 ms 1872 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 56 ms 12996 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 651 ms 95428 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 746 ms 93640 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -