lightoj 1008 - Fibsieve`s Fantabulous Birthday
来源:互联网 发布:java微信飞机大战 编辑:程序博客网 时间:2024/05/19 23:14
第一次做lightoj的题,有点伤。oj上不承认__int64,也不支持%I64d,只能用long long 和%lld,
%lld貌似cfree和vc否不能编译,下次只能先用%I64调一下,提交前改成%lld了。。。
另外,感觉最近效率有点低了,要注意下~~
#include<stdio.h>#include<math.h>int main(){int k,t;long long n,i,j;scanf("%d",&t);for(k=1;k<=t;k++){scanf("%lld",&n);printf("Case %d: ",k);long long m=(long long)sqrt(n);if(m*m==n)m--;n-=m*m;if(m&1){if(n<=m+1) printf("%lld %lld\n",n,m+1); else printf("%lld %lld\n",m+1,2*m+2-n);}else{if(n<=m+1) printf("%lld %lld\n",m+1,n); else printf("%lld %lld\n",2*m+2-n,m+1);}}return 0;}
- lightoj 1008 - Fibsieve`s Fantabulous Birthday
- LightOJ 1008 - Fibsieve`s Fantabulous Birthday
- lightOJ 1008 - Fibsieve`s Fantabulous Birthday
- LightOJ 1008 - Fibsieve`s Fantabulous Birthday (规律)
- 【思维】LightOj Fibsieve`s Fantabulous Birthday 1008
- LightOJ-1008 Fibsieve`s Fantabulous Birthday
- 1008 - Fibsieve`s Fantabulous Birthday (lightoj)
- lightoj 1008 - Fibsieve`s Fantabulous Birthday 乱搞
- LightOJ 1008 Fibsieve`s Fantabulous Birthday
- Lightoj 1008 - Fibsieve`s Fantabulous Birthday
- LightOJ 1008 Fibsieve`s Fantabulous Birthday
- 【LightOJ 1008 Fibsieve`s Fantabulous Birthday】
- lightoj 1008 - Fibsieve`s Fantabulous Birthday
- LightOJ-1008-Fibsieve`s Fantabulous Birthday [规律]
- lightoj 1008 - Fibsieve`s Fantabulous Birthday 【数学 找规律】
- lightoj--1008--Fibsieve`s Fantabulous Birthday(水题)
- 【LightOJ】1008 - Fibsieve`s Fantabulous Birthday(规律)
- lightoj-1008 - Fibsieve`s Fantabulous Birthday【思维】【找规律】
- 计算方法之用高斯列主元消去法求线性方程组
- 一键搞定Java桌面应用安装部署—exe4j+Inno Setup+JRE
- 怎样求FIRST集与FOLLOW集
- shiro 与 redis 结合的解决方案 shiro-redis
- 一键搞定JavaEE应用,JRE+Tomcat+Mysql-JaveEE绿色运行环境JTM0.9版
- lightoj 1008 - Fibsieve`s Fantabulous Birthday
- 搭建Eclipse+MyEclipse开发环境
- 计算方法之用追赶法求线性方程组
- Socket中winsock.h和winsock2.h的不同
- Hibernate n+1问题
- Eclipse调试方法和常用快捷键
- 计算方法之用雅克比法求线性方程组
- WPF依赖属性
- IOS第三十天——利用xml解析查询火车票信息