Compile Error
/in/foo.cc:2:94: error: bad value (native) for option("arch=") attribute #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native,arch=native") ^ In file included from /usr/include/c++/6/cassert:44:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:33, from /in/foo.cc:3: /usr/include/assert.h:71:43: error: bad value (native) for option("arch=") attribute __THROW __attribute__ ((__noreturn__)); ^ /usr/include/assert.h:71:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:71:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:71:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:76:43: error: bad value (native) for option("arch=") attribute __THROW __attribute__ ((__noreturn__)); ^ /usr/include/assert.h:76:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:76:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:76:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:82:43: error: bad value (native) for option("arch=") attribute __THROW __attribute__ ((__noreturn__)); ^ /usr/include/assert.h:82:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:82:43: error: bad value (native) for option("arch=") attribute /usr/include/assert.h:82:43: error: bad value (native) for option("arch=") attribute In file included from /usr/include/endian.h:60:0, from /usr/include/ctype.h:39, from /usr/include/c++/6/cctype:42, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:35, from /in/foo.cc:3: /usr/include/x86_64-linux-gnu/bits/byteswap.h:45:31: error: bad value (native) for option("arch=") attribute __bswap_32 (unsigned int __bsx) ^ /usr/include/x86_64-linux-gnu/bits/byteswap.h:45:31: error: bad value (native) for option("arch=") attribute /usr/include/x86_64-linux-gnu/bits/byteswap.h:109:29: error: bad value (native) for option("arch=") attribute __bswap_64 (__uint64_t __bsx) ^ /usr/include/x86_64-linux-gnu/bits/byteswap.h:109:29: error: bad value (native) for option("arch=") attribute In file included from /usr/include/c++/6/cctype:42:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:35, from /in/foo.cc:3: /usr/include/ctype.h:80:40: error: bad value (native) for option("arch=") attribute __THROW __attribute__ ((__const__)); ^ /usr/include/ctype.h:80:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:80:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:80:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:82:40: error: bad value (native) for option("arch=") attribute __THROW __attribute__ ((__const__)); ^ /usr/include/ctype.h:82:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:82:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:82:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:84:40: error: bad value (native) for option("arch=") attribute __THROW __attribute__ ((__const__)); ^ /usr/include/ctype.h:84:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:84:40: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:84:40: error: bad value (native) for option("arch=") attribute In file included from /usr/include/features.h:364:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:507, from /usr/include/c++/6/cassert:43, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:33, from /in/foo.cc:3: /usr/include/ctype.h:110:1: error: bad value (native) for option("arch=") attribute __exctype (isalnum); ^ /usr/include/ctype.h:110:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:110:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:110:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:111:1: error: bad value (native) for option("arch=") attribute __exctype (isalpha); ^ /usr/include/ctype.h:111:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:111:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:111:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:112:1: error: bad value (native) for option("arch=") attribute __exctype (iscntrl); ^ /usr/include/ctype.h:112:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:112:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:112:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:113:1: error: bad value (native) for option("arch=") attribute __exctype (isdigit); ^ /usr/include/ctype.h:113:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:113:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:113:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:114:1: error: bad value (native) for option("arch=") attribute __exctype (islower); ^ /usr/include/ctype.h:114:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:114:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:114:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:115:1: error: bad value (native) for option("arch=") attribute __exctype (isgraph); ^ /usr/include/ctype.h:115:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:115:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:115:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:116:1: error: bad value (native) for option("arch=") attribute __exctype (isprint); ^ /usr/include/ctype.h:116:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:116:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:116:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:117:1: error: bad value (native) for option("arch=") attribute __exctype (ispunct); ^ /usr/include/ctype.h:117:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:117:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:117:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:118:1: error: bad value (native) for option("arch=") attribute __exctype (isspace); ^ /usr/include/ctype.h:118:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:118:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:118:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:119:1: error: bad value (native) for option("arch=") attribute __exctype (isupper); ^ /usr/include/ctype.h:119:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:119:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:119:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:120:1: error: bad value (native) for option("arch=") attribute __exctype (isxdigit); ^ /usr/include/ctype.h:120:1: error: bad value (native) for option("arch=") attribute /usr/include/ctype.h:120:1:
代码
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native,arch=native")
#include <bits/stdc++.h>
#define N 2000020
using namespace std;
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());
while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
return f?x:-x;
}
int pri[N], mark[N], p[N], cnt;
void shai(int n) {
for (int i = 2; i <= n; ++ i) {
if (!mark[i]) pri[++ cnt] = i, p[i] = i;
for (int j = 1; j <= cnt && i * pri[j] <= n; ++ j) {
mark[i * pri[j]] = 1;
p[i * pri[j]] = pri[j];
}
}
}
int a[N], tot, bs[N], totb, cs[N];
void chai(int x) {
while (x > 1) {
int ps = p[x];
x /= ps;
a[++ tot] = ps;
}
}
long long MAX_DFS = 0, damn;
int ans = 0, res = 0;
long long fuck[N], bbs[N];
int A;
double srt;
void dfs(int d, long long val) {
if (val > MAX_DFS) return;
if (d > totb) {
if (val * val < damn) return;
int cpb = val;
int cmb = damn / cpb;
if ((cmb + cpb) & 1) {
return;
}
int c = (cpb + cmb) >> 1;
int b = (cpb - cmb) >> 1;
if (b < A) {
return;
}
++ ans;
res ^= (A + b) ^ c;
// printf("Found %d %d %d\n", A, b, c);
return;
}
if (val * fuck[d] < A) return;
for (int i = 0; i <= cs[d]; ++ i) {
dfs(d + 1, val);
val = val * bs[d];
}
}
int main() {
int n = read();
shai(2000001);
int sss=n-sqrt(((long long)n*n+1)/2);
for (A = 2; A <= sss; ++ A) {
// (a-1)(a+1) = (c-b)(c+b)
damn = (long long) A * A - 1;
tot = 0;
chai(A - 1);
chai(A + 1);
MAX_DFS = n - A;
sort(a + 1, a + tot + 1);
totb = 0;
for (int i = 1; i <= tot; ++ i) {
if (a[i] != a[i - 1]) {
bs[++ totb] = a[i];
cs[totb] = 1;
bbs[totb] = a[i];
} else {
cs[totb] ++;
bbs[totb] *= a[i];
}
}
fuck[totb + 1] = 1;
for (int i = totb; i; -- i) {
fuck[i] = fuck[i + 1] * bbs[i];
}
// if (A == 1651) {
// for (int i = 1; i <= totb; ++ i) {
// printf("%d %d %lld %lld\n", bs[i], cs[i], bbs[i], fuck[i]);
// }
// return 0;
// }
dfs(1, 1);
}
for (int i = 1; 2*i+1 <= n; ++ i) {
++ ans;
res ^= (i + 1) ^ i;
}
printf("%d %d\n", ans, res);
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1003 hitwh 2019 新生赛 D Songer 的排兵布阵
- 语言
- C++
- 递交时间
- 2020-12-17 17:11:19
- 评测时间
- 2020-12-17 17:11:19
- 评测机
- 分数
- 0
- 总耗时
- 0ms
- 峰值内存
- 0 Bytes