摘要: #include #include #include #include #include #define ll long long using namespace std; int main(){ int n; int k=0; while(1){ k++; scanf("%d",&n); if (n==0)break; int m=sqrt(n+... 阅读全文
posted @ 2018-10-19 23:53 bluefly-hrbust 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define rep(i,j,k) for(int i=j;i<=k;i++) using namespace std; const int N = 10007; bool is_prime[N]; int prime[N]; int cnt=0; void get_prime(){ int m=s... 阅读全文
posted @ 2018-10-19 22:58 bluefly-hrbust 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define ll long long #define ULL unsigned long long using namespace std; const int maxx = 1e6+5; ll fac[maxx]; int pow_mod(ULL a,ULL n,ULL m){ if (n==0)... 阅读全文
posted @ 2018-10-19 21:13 bluefly-hrbust 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define ll long long #define rep(i,j,k) for(int i=j;i<=k;++i) using namespace std; const int maxx = 1e4+7; ll a[maxx]; void ex_gcd(ll a,ll b,ll &d,ll &x,ll &y) { ... 阅读全文
posted @ 2018-10-19 21:12 bluefly-hrbust 阅读(116) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define ll long long using namespace std; ll gcd(ll a,ll b){ return a%b==0?b:gcd(b,a%b); } int main(){ ll a,b; ll ans1,ans2; while(~scanf("%lld%lld",&a,&b)... 阅读全文
posted @ 2018-10-19 00:14 bluefly-hrbust 阅读(387) 评论(0) 推荐(0) 编辑