<thead id="9zpv1"><ins id="9zpv1"><dl id="9zpv1"></dl></ins></thead>
<cite id="9zpv1"></cite>
<ins id="9zpv1"><span id="9zpv1"><cite id="9zpv1"></cite></span></ins><var id="9zpv1"></var>
<var id="9zpv1"><strike id="9zpv1"></strike></var>
<var id="9zpv1"></var>
<var id="9zpv1"><video id="9zpv1"><thead id="9zpv1"></thead></video></var><var id="9zpv1"></var>
<cite id="9zpv1"></cite><var id="9zpv1"><strike id="9zpv1"><listing id="9zpv1"></listing></strike></var>
<var id="9zpv1"><strike id="9zpv1"></strike></var>
<var id="9zpv1"></var>
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

Re:我的代碼無敵了

Posted by x604078488 at 2013-09-14 01:51:19 on Problem 1001
In Reply To:也給一些測試數據(總結了前輩的) Posted by:ljxluois at 2007-08-14 01:34:10
這上面的全測試過了還是WA....我把VC6.0編譯的發上來...誰給看看...
// Note:Your choice is C++ IDE
#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
vector<int> pow(char *R,int n){
	int r[5];
    vector<int> s(100,0);
    vector<int> y(100,0);
    y[99]=1;
    for(int i=0,j=0;R[i];i++){
    	if(R[i]!='.'){
    		r[j]=R[i]-48;
    		j++;}
    }
    for(i=0;i<n;i++){
    	for(int q=0;q<100;q++)
    	s[q]=0;
        for(int p=99;p>=4;p--){
    		for(int k=4;k>=0;k--){
    			s[p+k-4]+=y[p]*r[k];}
        }
    	for(int l=99,m=0;l>0;l--){
    		m=s[l];
    		s[l]=s[l]%10;
    		s[l-1]+=m/10;}
    	for(q=0;q<100;q++)
    	y[q]=s[q];
    }
    return  s;
}
	
int main()
{
    char r[10];
    int n,pot=0;
    while(scanf("%s %d",r,&n)!=EOF){
    for(int i=0;r[i];i++)
    if(r[i]=='.')
    pot=5-i;
    if(pot==0){
    	for(i=0;i<5;i++){
    		r[i]=r[i+1];}
    }
    vector<int> answer(pow(r,n));
    int j,zero=1;
    for(i=0;i<100;i++){
    	if(answer[i]!=0){
    		zero=0;
    		break;}
    }
    if(zero==1){
    	cout<<zero-1;
    	return 0;}
    for(i=0;i<100&&answer[i]==0;i++){
    if(i+pot*n==99){
    	cout<<".";
    	j=i+1;
    	break;}
    j=i+1;}
    for(;j<100;j++){
    	int pp=0,q=j+1;
    	if(j==99)
    	pp=1;
    	for(;q<100;q++){
    		if(answer[q]!=0){
    			pp=1;
    			break;}
    	}
    	cout<<answer[j];
    	if(j>98-pot*n&&pp==0)
    	break;
    	if(j+pot*n==99&&pp==1&&j!=99)
    	cout<<".";}
    cout<<endl;}
    return 0;
}

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

国语自产拍在线视频中文,国语自产拍在线观看学生,国语自产精品视频在线视频