
Lv.1
只是喜欢Python而已……徒弟:程序侯
签名:只是喜欢Python而已…… 徒弟:程序侯
在 【C++之数据结构讲解】OI中的线段树详解 中回复
什么?极值你在还用线段树,现在四毛子树走起imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%BA%9C%E4%BA%86%E6%BA%9C%E4%BA%86.gif"alt="emotion_编程猫_溜了溜了"
2021-10-28T17:57:22 点赞:0
在 [喵] 萌新也能做PVP地图了? 中回复
;((args)=>{world.onPlayerJoin(({entity})=>{entity.enableDamage=true});world.onPress(({entity,button,raycast:{hitEntity,direction}})=>{if(button!=='action0'||!hitEntity||!hitEntity.isPlayer)return;if(args[0]){direction.x*=args[1];direction.y*=args[1];direction.z*=args[1];hitEntity.velocity=direction}if(args[2]){hitEntity.hurt(args[5],{attacker:entity})}else{hitEntity.hurt(args[5])}if(args[3]){hitEntity.player.directMessage(args[4].replace("@1",entity.player.name).replace("@2",args[5]))}})})([true,"0.7",true,true,"💘 @1 hits you (damage = @2)","10"]);
2021-11-08T12:50:52 点赞:0
在 【神岛《章鱼游戏》你可能不知道的那些事】 中回复
这里有一个获胜方法[几率99%]
如果你是选数字的,按照114514的顺序选
如果你是猜的,按照奇变偶不变的顺序猜
![]()
2021-11-20T22:01:36 点赞:1
在 找师傅了~~~~ 中回复
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <string>
#include <bitset>
using namespace std;
bitset<128> ans[16];
int n, m, on[128], off[128], top, top1, top2;
bool check(bitset<128> a) {
for (int i = 0; i < top1; ++i) if (!a[on[i]]) return false;
for (int i = 0; i < top2; ++i) if (a[off[i]]) return false;
return true;
}
bool cmp(bitset<128> a, bitset<128> b) {
for (int i = n - 1; i >= 0; --i) {
if (int(a[i]) > int(b[i])) return false;
if (int(a[i]) < int(b[i])) return true;
}
return false;
}
bool eql(bitset<128> a, bitset<128> b) {
for (int i = n - 1; i >= 0; --i) {
if (int(a[i]) != int(b[i])) return false;
}
return true;
}
int main() {
cin >> n >> m;
int p = 0; cin >> p; while (p != -1) {
on[top1++] = n - p;
cin >> p;
}
p = 0; cin >> p; while (p != -1) {
off[top2++] = n - p;
cin >> p;
}
for (int i = 0; i < 16; ++i) {
int k = 0; bitset<128> a;
a.flip();
if (i & 1) { a.flip(); }
if (i & 2) for (int i = 2; i <= n; i += 2) { a.flip(n - i); }
if (i & 4) for (int i = 1; i <= n; i += 2) { a.flip(n - i); }
if (i & 8) for (int i = 1; i <= n; i += 3) { a.flip(n - i); }
for (int j = 0 ; j < 4 ; ++ j) if (i & (1 << j)) k++;
if (check(a) && ((k & 1) == (m & 1)) && k <= m) {ans[top++] = a;/*cout << i << endl;*/}
}
sort(ans, ans + top, cmp);
top = unique(ans, ans + top , eql) - ans;
if (!top) {
cout << "IMPOSSIBLE";
return 0;
}
for (int i = 0; i < top; ++i) {
string str = ans[i].to_string();
str.erase(0, str.size() - n);
cout << str << endl;
}
}
看得懂?
2021-11-27T12:17:44 点赞:0