
ACM_二进制
呆雁1707
这个作者很懒,什么都没留下…
展开
-
NYOJ 528 找球号(三)
原题链接:传送门 这道题可以用set写,但是发现用二进制的按位异或会更加简单。 按位异或是相同位为0,不同位为1. 如: 1^1 = 0 1^0 = 1 1^2^1 = 1^1^2 = 2 所以可以通过异或来找这个只出现了一次的值。 #include <iostream> #include <cstdio> using namespace std; i...原创 2018-07-19 15:20:58 · 161 阅读 · 1 评论 -
Hello 2019 B - Petr and a Combination Lock
原题链接:传送门 给你n个数,问你经过加或减的操作,最后和是否能整除360。 二进制枚举 #include <bits/stdc++.h> using namespace std; const int N = 20; int a[N]; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++)...原创 2019-01-05 16:49:27 · 351 阅读 · 0 评论