跳过正文
  1. Posts/

codeforces #346 div 2 A. Round House

·160 字·1 分钟

题目链接

水题 乱搞。

 1/* ***********************************************
 2Author :111qqz
 3Created Time :2016年03月30日 星期三 23时59分47秒
 4File Name :code/cf/#346/A.cpp
 5************************************************ */
 6
 7#include <cstdio>
 8#include <cstring>
 9#include <iostream>
10#include <algorithm>
11#include <vector>
12#include <queue>
13#include <set>
14#include <map>
15#include <string>
16#include <cmath>
17#include <cstdlib>
18#include <ctime>
19#define fst first
20#define sec second
21#define lson l,m,rt<<1
22#define rson m+1,r,rt<<1|1
23#define ms(a,x) memset(a,x,sizeof(a))
24typedef long long LL;
25#define pi pair < int ,int >
26#define MP make_pair
27
28using namespace std;
29const double eps = 1E-8;
30const int dx4[4]={1,0,0,-1};
31const int dy4[4]={0,-1,1,0};
32const int inf = 0x3f3f3f3f;
33int n,a,b;
34int main()
35{
36	#ifndef  ONLINE_JUDGE
37	freopen("code/in.txt","r",stdin);
38  #endif
39	cin>>n>>a>>b;
40	a = a + b;
41	while (a<=0) a+=n;
42	while (a>n) a-=n;
43	cout<<a<<endl;
44
45  #ifndef ONLINE_JUDGE
46  fclose(stdin);
47  #endif
48    return 0;
49}

相关文章

codeforces croc 2016 C. Enduring Exodus

·472 字·1 分钟
题目链接 题意:给出n和k,给出一个长度为n的字符串表示房间的占用情况(0表示没占用,1表示已占用),从n个房间中找出k+1个,使得k+1中的k个距离k+1个中的1个的距离和最小。

codeforces 519 C. A and B and Team Training

·268 字·1 分钟
http://codeforces.com/problemset/problem/519/C 题意:两种组队方式,3人一组,1个大牛+2个蒟蒻或者1个蒟蒻+2个大牛。给定大牛和蒟蒻的个数。问最多能组多少队。 思路:线性规划。设两种队分别有x,y个即可。 突然发现这题以前做过。。。比当时的代码简单了一些。还不错。

codeforces #334 div 2 C. Alternative Thinking

·514 字·2 分钟
题意:给定一个01串。要进行一次变换:选一段连续的非空的字串,将这段串的0和1反转(0变成1,1变成0) 然后问能得到的最长的0,1交替的序列的长度是多少(不一定连续)

codeforces #332 div 2 C. Day at the Beach

·558 字·2 分钟
C. Day at the Beach time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Squidward, Spongebob and Patrick decided to go to the beach. Unfortunately, the weather was bad, so the friends were unable to ride waves. However, they decided to spent their time building sand castles.