# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1091056 | 2024-09-19T15:58:02 Z | Abito | Floppy (RMI20_floppy) | C++17 | 23 ms | 6524 KB |
#include <bits/stdc++.h> #include "floppy.h" #define pb push_back using namespace std; void read_array(int subtask_id, const std::vector<int> &v) { stack<int> s; int n=v.size(),b[n]; string ans=""; for (int i=n-1;i>=0;i--){ b[i]=0; while (!s.empty() && v[s.top()]<v[i]) s.pop(); if (!s.empty()) b[i]=s.top(); s.push(i); } for (int i=0;i<n;i++){ for (int j=0;j<13;j++){ if (b[i]&(1<<j)) ans+='1'; else ans+='0'; } } //for (int i=0;i<n;i++) cout<<b[i]<<' ';cout<<endl; save_to_floppy(ans); return; } std::vector<int> solve_queries(int subtask_id, int n, const std::string &bits, const std::vector<int> &L, const std::vector<int> &R) { vector<int> ans; int c[n]; for (int i=0;i<n;i++){ c[i]=0; for (int j=i*13;j<(i+1)*13;j++){ if (bits[j]=='1') c[i]|=(1<<(j-i*13)); } } for (int i=0;i<L.size();i++){ int l=L[i],r=R[i]; while (true){ if (c[l]==0 || c[l]>r) break; l=c[l]; } ans.pb(l); } //for (auto u:ans) cout<<u<<' ';cout<<endl; return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 820 KB | Output is correct |
2 | Correct | 1 ms | 824 KB | Output is correct |
3 | Correct | 1 ms | 824 KB | Output is correct |
4 | Correct | 1 ms | 920 KB | Output is correct |
5 | Correct | 1 ms | 832 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 4264 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 6524 KB | L is too large |
2 | Halted | 0 ms | 0 KB | - |