Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

最蠢的ac方法

Posted by teitoku at 2017-03-10 22:19:51 on Problem 3750
#include <iostream>  
#include<cmath>  
#include<stdio.h>  
#include<cstring>  
#include <algorithm>
#include <cctype>
#include <utility>
#include <map>
#include <string>
#include <cstdlib>
using namespace std;


int a[10000000];
char na[70][17];
int zhuang[70];
int main()
{

	int n;
	scanf("%d", &n);
	int hao = 1;
	for (int i = 1; i <= 10000000; i++)
	{
		if (hao > n)
			hao = 1;
		a[i] = hao;
		hao++;
	}
	for (int i = 1; i <= n; i++)
	{
		scanf("%s", na[i]);
	}
	int w, s;
	scanf("%d", &w);
	getchar();
	scanf("%d", &s);
	int bao = 1;

	for (int i = w; i < 10000000; i++)
	{
		while (zhuang[a[i]] != 0)
		{
			i++;
		}
		if (bao == s)
		{

			zhuang[a[i]] = 1;
			puts(na[a[i]]);
			bao = 1;
			n--;
			if (n == 0)
				break;

		}
		else
		{
			bao++;
		}
	}
	
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator