AC代码

#include <cstdio>
const int max_n = 1000;
long long ans[max_n];
int num = 0;
void change(long long a, long long d) {
do {
ans[num++] = a % d;
a /= d;
} while(a != 0);
} int main() {
#ifdef ONLINE_JUDGE
#else
freopen("1.txt", "r", stdin);
#endif // ONLINE_JUDGE}
long long a, d;
scanf("%lld %lld", &a, &d);
change(a, d);
bool flag = 1;
for(int i = 0; i < num - 1- i; i++) {
if(ans[i] != ans[num - 1 - i]) flag = false;
}
if(flag == true) printf("Yes\n");
else if(flag == false) printf("No\n");
for(int i = num - 1; i >= 0; i--) {
if(i != num - 1) printf(" ");
printf("%d", ans[i]);
}
return 0;
}

最新文章

  1. Web:AJAX的详解
  2. HDU 2594 Simpsons’ Hidden Talents(辛普森一家的潜在天赋)
  3. 2016 - 1- 21 - RunLoop使用(2016-1-24修改一次)&amp;(2016 - 1 - 24 再次修改)
  4. easyUI之datebox
  5. poj 2828 Buy Tickets (线段树)
  6. DeDe缩略图路径的修改
  7. 剑指offer 27二叉搜索树与双向链表
  8. BZOJ 2242: [SDOI2011]计算器( 快速幂 + 扩展欧几里德 + BSGS )
  9. 给一个非常长的字符串str 另一个字符集比方{a,b,c} 找出str 里包括{a,b,c}的最短子串。要求O(n)
  10. zoj2760(最大流)
  11. Oracle SQL Lesson (11) - 创建其他数据库对象(试图/序列/索引/同义词)
  12. hihoCoder #1094 : Lost in the City(枚举,微软苏州校招笔试 12月27日 )
  13. Java学习网站大全
  14. Kube-DNS搭建(1.4版本)
  15. 中间件RabbitMQ之运维篇
  16. 【题解】Luogu P3901 数列找不同
  17. [leetcode]122. Best Time to Buy and Sell Stock II 最佳炒股时机之二
  18. Python爬虫项目--爬取自如网房源信息
  19. pycharm 光标快速移动到括号外或行尾
  20. [Algorithm] Deferred Acceptance Algorithm

热门文章

  1. 分布式缓存Redis之Pipeline(管道)
  2. PHP反序列化学习
  3. Redis订阅广播实现多级缓存
  4. 【软件工程】Beta冲刺(3/5)
  5. How to use reminder feature of the outlook
  6. opencv配置运行问题
  7. mysql的启动问题
  8. 在 bat 批处理中运行多次 mvn
  9. iOS tableHeaderView有默认高度?
  10. Eclipse中给SVN添加项目