CF 13A

意思就是算2到n-1进制的个位数和,然后与n-2求gcd

#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;
const double eps=1e-8;
int sgn(double a){return a<-eps?-1:a<eps?0:1;}
int main()
{
    int n,sum=0,tmp=0,t;
    scanf("%d",&n);
    for(int i=2;i<=n-1;i++)
    {
        t=n;
        while(t) {sum+=t%i;t/=i;}
        tmp+=sum/(n-2);
        sum%=(n-2);
    }
    n-=2;
    if(sum!=0)
    {
        t=__gcd(sum,n);sum/=t;n/=t;
    }
    sum+=n*tmp;
    if(sum!=0)
    {
        t=__gcd(sum,n);sum/=t;n/=t;
    }
    else n=1;
    printf("%d/%d\n",sum,n);
}
08-31 12:42:52.997 10201 17566 17566 F DEBUG : #00 pc 000000000037ea70 /vendor/lib64/libllvm-qgl.so (!!!0000!3e03f5085a129f46fa8ed3d1f1d2aa!eda8e4c1fb!+592) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #01 pc 000000000037dfec /vendor/lib64/libllvm-qgl.so (!!!0000!1d0c40ad4baefbab8a24e6fc7c5eba!eda8e4c1fb!+588) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #02 pc 0000000000507be4 /vendor/lib64/libllvm-qgl.so (!!!0000!1acb0ec3d67182b35dbf5099bbc199!eda8e4c1fb!+164) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #03 pc 0000000000507aa8 /vendor/lib64/libllvm-qgl.so (!!!0000!830669e960b911e7d9f628ab0eae17!eda8e4c1fb!+72) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #04 pc 000000000099cffc /vendor/lib64/libllvm-qgl.so (!!!0000!a6c4e54c31882eaccb65b97888ceb7!eda8e4c1fb!+108) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #05 pc 000000000099cf80 /vendor/lib64/libllvm-qgl.so (!!!0000!7576c1e64343062569f4cb917ac9cd!eda8e4c1fb!+16) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #06 pc 0000000000f26de8 /vendor/lib64/libllvm-qgl.so (!!!0000!13a0d3a1239e7c78308c1116a0936d!eda8e4c1fb!+1352) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #07 pc 0000000000edb778 /vendor/lib64/libllvm-qgl.so (!!!0000!5b183a50d5b6220e2148abbc5665b8!eda8e4c1fb!+2296) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #08 pc 0000000000ee291c /vendor/lib64/libllvm-qgl.so (!!!0000!2a0e64fac242bfae72d2abfa8ce29b!eda8e4c1fb!+44) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #09 pc 00000000011d7190 /vendor/lib64/libllvm-qgl.so (!!!0000!1e9735fa2d7fa7113c5ea09cbdfdc0!eda8e4c1fb!+592) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #10 pc 00000000011d6780 /vendor/lib64/libllvm-qgl.so (!!!0000!aefccce6a332610a9b22f30d0961cc!eda8e4c1fb!+736) (BuildId: ca318b524af7b4a7abac8e8946098cf9) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #11 pc 00000000001b6dc0 /vendor/lib64/hw/vulkan.adreno.so (!!!0000!b46861eb17b97158fc26d3e1e8cc0a!eda8e4c1fb!+2944) (BuildId: 9328836a87ac0ac31a198f14566d30a8) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #12 pc 00000000001b5fe4 /vendor/lib64/hw/vulkan.adreno.so (!!!0000!2aa5082753cd3c7ad1b8091f24093d!eda8e4c1fb!+420) (BuildId: 9328836a87ac0ac31a198f14566d30a8) 08-31 12:42:52.997 10201 17566 17566 F DEBUG : #13 pc 00000000002187b0 /vendor/lib64/hw/vulkan.adreno.so (qglinternal::vkCreateGraphicsPipelines(VkDevice_T*, VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*, VkAllocationCallbacks const*, VkPipeline_T**)+17936) (BuildId: 9328836a87ac0ac31a198f14566d30a8)
最新发布
09-26
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值