- 字符串
为何 95pts
- @ 2026-10-18 21:44:50
#include<bits/stdc++.h>
#define int long long
#define gc getchar
#define pc putchar
#define rg register
#define LB lower_bound
#define UB upper_bound
#define PII pair<int, int>
#define PDI pair<double, int>
#define fi first
#define se second
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using db=double;using ll=long long;
using ull=unsigned long long;
using namespace std;
const ll INF=1e18;
const int inf=0x3f3f3f3f;
namespace IO{
inline ll read(){
ll x=0,f=1;
char ch=gc();
while(!isdigit(ch)){
if(ch=='-') f=-f;
ch=gc();
}
while(isdigit(ch)) x=(x<<1)+(x<<3)+ch-'0',ch=gc();
return x*f;
}
inline void write(ll x){
if(x<0) pc('-'),x=-x;
if(x>9) write(x/10);
pc(x%10+'0');
}
}using namespace IO;
const int N=2e5+10,U=1ll<<60;
int n,l[N],f[N],g[N];
vector<int> ans;
signed main(){
// freopen("string.in","r",stdin);
// freopen("string.out","w",stdout);
n=read();
for(rg int i=1;i<=n;i++) l[i]=read();
f[0]=0;
for(rg int i=1;i<=n;i++){
int w=1ll<<(60-l[i]);
f[i]=w*((f[i-1]+w-1)/w+1);
}
g[n+1]=U;
for(rg int i=n;i>=1;i--){
int w=1ll<<(60-l[i]);
g[i]=w*(g[i+1]/w-1);
}
for(rg int i=1;i<=n;i++) if(f[i-1]<=g[i+1]) ans.push_back(i);
write(ans.size()),pc(' ');
for(int pos:ans) write(pos),pc(' ');
return 0;
}
1 条评论
-
GQ26-914 LV 3 @ 2026-10-18 21:46:20
第 11 个点 output longer than std
- 1
信息
- ID
- 19
- 时间
- ms
- 内存
- MiB
- 难度
- 待评估
- 标签
- (无)
- 递交数
- 203
- 已通过
- 47
- 上传者