92A. Chips
来源:互联网 发布:中山瑞达软件 编辑:程序博客网 时间:2024/05/24 03:40
题目—92A
题意分析:有 n 只海象,按 1~n 顺时针编号排序,围成一个圈。有 m 个薯片,从 1 号开始,按顺时针发放,发给当前海象的薯片数量与它的编号一致。如果,当前剩余薯片数量不足以发放给当前海象,则停止发放。问最后剩余的薯片数量。
#include <stdio.h>int main() { int n,m,res=0; scanf("%d %d",&n,&m); while(m>0){ for(int i=1;i<=n;i++){ if(m>=i){ m -= i; }else{ res = m; m = -1; // while i = n+1; // for } } } printf("%d",res); return 0; }
阅读全文
0 0
- Codeforces 92A-Chips
- 92A. Chips
- A. Chips
- 【巧模拟】#75 A. Chips
- Chips
- Codeforces Beta Round #75 (Div. 2)---A. Chips
- STL chips
- STL chips
- Multithread chips
- PerfHud chips
- chips of wow
- gpu hardware chips[11.20]
- c++/c chips
- 迭代开发chips
- visual studio chips
- 宏(preprocessor)系列 chips
- AP、OS or Chips?
- CF-333B - Chips
- epoll边沿模式---自言自语
- Ubuntu 出现apt-get: Package has no installation candidate问题
- Jquery--工具方法
- maven安装与环境配置
- JAVA进程CPU占用过高快速定位
- 92A. Chips
- MySQL DBA的基础面试题目
- postman安装
- JUnit4 源码阅读(二)
- eclipse ***.jar cannot be read or is not a valid ZIP fileBuild Path Problem
- Linux的proc文件系统
- MYSQL重点笔记
- ubuntu下复制大文件
- 完美人如何培养自己的气质