P1014题解

· · 题解

不知道题目的快去看!!!!!

一个很傻逼 大聪明的算法

不管了,加钠上题解!

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n;
    x=sqrt(0.25+2.0*n)+1.4999;
    y=n-(x-2)*(x-1)/2;
    if(y==0)x--,y++;
    if(x%2)cout<<y<<'/'<<x-y;
    else cout<<x-y<<'/'<<y;
    return 0;
}

秒了!