P1319 压缩技术 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
题解 P1319 【压缩技术】 - RedContritio 的博客 - 洛谷博客 (luogu.com.cn)
#include<bits/stdc++.h> using namespace std; int n,p,q,t; int main() { for(cin>>n;cin>>p;t^=1){ for(;p--;q++){ if(q==n) q=0&putchar(' '); putchar('0'+t); } } return 0; }