update gitignore. update compile.sh
This commit is contained in:
@@ -2,20 +2,18 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
bool comp(unsigned int a, unsigned int b) {
|
||||
int cnt_bit(unsigned int a) {
|
||||
int res1 = 0;
|
||||
while (a != 0) {
|
||||
res1 += a & 1;
|
||||
a = a >> 1;
|
||||
}
|
||||
|
||||
int res2 = 0;
|
||||
while (b != 0) {
|
||||
res2 += b & 1;
|
||||
b = b >> 1;
|
||||
}
|
||||
return res1;
|
||||
}
|
||||
|
||||
return res1 < res2;
|
||||
bool comp(unsigned int a, unsigned int b) {
|
||||
return cnt_bit(a) < cnt_bit(b);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ int main() {
|
||||
mp[name].push_back(grade);
|
||||
}
|
||||
|
||||
for (auto x : mp) {
|
||||
for (auto& x : mp) {
|
||||
std::cout << x.first << " ";
|
||||
|
||||
double tmp = 0;
|
||||
int n = 0;
|
||||
for (auto i : x.second) {
|
||||
for (auto& i : x.second) {
|
||||
tmp += i;
|
||||
++n;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ int main() {
|
||||
mp[std::make_pair(r, c)] %= mod;
|
||||
}
|
||||
|
||||
for (auto x : mp) {
|
||||
for (auto& x : mp) {
|
||||
if (x.second) std::cout << x.first.first << " " << x.first.second << " " << x.second << std::endl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user