# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
799340 |
2023-07-31T12:55:54 Z |
BidoTeima |
Sticks (POI11_pat) |
C++17 |
|
374 ms |
32420 KB |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 1e6 + 4;
vector<int>mn,mx,color;
ll st[4 * N];
void build(int l, int r, int node){
if(l == r){
st[node] = 1<<color[l];
return;
}
int mid = (l + r) >> 1;
build(l, mid, 2 * node + 1);
build(mid + 1, r, 2 * node + 2);
st[node] = st[2 * node + 1] | st[2 * node + 2];
}
ll query(int ql, int qr, int l, int r, int node){
if(l > qr || r < ql)
return 0;
if(ql <= l && r <= qr){
return st[node];
}
int mid = (l + r) >> 1;
return query(ql, qr, l, mid, 2 * node + 1) | query(ql, qr, mid + 1, r, 2 * node + 2);
}
int main() {
int k;
cin>>k;
vector<pair<int,int>>arr;
for(int i = 0; i < k; i++){
int n;
cin>>n;
for(int j = 0; j < n; j++){
int w;
cin>>w;
arr.push_back(make_pair(w, i));
}
}
sort(arr.begin(), arr.end());
int curmn=arr[0].first,curmx=arr[0].first,curc=arr[0].second;
for(int i = 1; i < (int)arr.size(); i++){
if(arr[i].second != arr[i - 1].second){
mn.push_back(curmn);
mx.push_back(curmx);
color.push_back(curc);
curmn=curmx=arr[i].first,curc=arr[i].second;
}
}
mn.push_back(curmn);
mx.push_back(curmx);
color.push_back(curc);
int n = (int)color.size();
return 0;
}
Compilation message
pat.cpp: In function 'int main()':
pat.cpp:52:9: warning: unused variable 'n' [-Wunused-variable]
52 | int n = (int)color.size();
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
452 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
852 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
2024 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
186 ms |
16328 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
188 ms |
16384 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
374 ms |
31528 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
368 ms |
32420 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |