| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1370503 | psigurd | 모자이크 (IOI24_mosaic) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> mosaic(vector<int> X, vector<int> Y, vector<int> T, vector<int> B, vector<int> L, vector<int> R){
vector<ll> ans;
int n = X.size();
vector<ll> pref(n + 1, 0);
for (int i = 0; i < n; i++){
pref[i + 1] = pref[i] + X[i];
}
int q = T.size();
for (int i = 0; i < q; i++){
ans.push_back(pref[R[i] + 1] - pref[L[i]]);
}
return ans;
}
int main(){
vector<ll> ans = mosaic({1, 0, 1, 0}, {1, 1, 0, 1}, {0, 0}, {0, 0}, {0, 0}, {3, 2});
for (auto &p : ans){
cout << p << "\n";
}
return 0;
}