Search found 19 matches

by thomas1016
Mon Dec 08, 2008 8:48 pm
Forum: Volume 105 (10500-10599)
Topic: 10583 - Ubiquitous Religions
Replies: 33
Views: 20359

Re: 10583 - Ubiquitous Religions

input

Code: Select all

3 3
1 1
2 2
3 3
3 3
1 1
1 1
1 1
0 0

output

Code: Select all


Case 1: 3
Case 2: 3
by thomas1016
Sun May 11, 2008 1:17 pm
Forum: Volume 3 (300-399)
Topic: 333 - Recognizing Good ISBNs
Replies: 166
Views: 40698

Re: 333 - Recognizing Good ISBNs - Need more In/Output samples

why a blank line have such a output?
"is incorrect."

not " is incorrect."
(<space>is incorrect.)
by thomas1016
Mon Jan 21, 2008 9:57 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 79331

Thx

Thanks a lot .
A blank line is truly a critical input !!!!

:P :P :P
by thomas1016
Sun Jan 20, 2008 5:19 pm
Forum: Volume 4 (400-499)
Topic: 478 - Points in Figures: Rectangles, Circles, Triangles
Replies: 44
Views: 16084

I modify my code

it is WA because of the sequence of figure




#include<iostream>

using namespace std;
int main(){
double rec[10][5];
double cir[10][4];
double tri[10][7];
bool fi[11];
double x,y;
char r;
int count, count2,fig,count3;;
bool in;
count=0;
count2=0;
count3=0;
int c2 ...
by thomas1016
Sat Jan 19, 2008 7:51 pm
Forum: Volume 4 (400-499)
Topic: 478 - Points in Figures: Rectangles, Circles, Triangles
Replies: 44
Views: 16084

I use a different way

I use a different way

it is a kind of "Linear Programming Models"

and i have tried the data which is correct

but i still get WA

>_<



#include<iostream>

using namespace std;
int main(){
double rec[10][5];
double cir[10][4];
double tri[10][7];
double x,y;
char r;
int count, count2,fig ...
by thomas1016
Fri Jan 18, 2008 5:51 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 21961

istringstream works !!!!

part of my code
I finally got AC :lol:

istringstream iss;

istringstream works !!!!
thanks a lot


#include<iostream>
#include<sstream>
#include<string>

using namespace std;
int pol(int,string);

void polf(string,string);

int main(){
int j,sum;
string po,k;

while(1){


if (!getline ...
by thomas1016
Sun Jun 18, 2006 12:24 pm
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 38826

483 PE Help PLZ

Can you guys tall me why it is PE???


#include <iostream>
#include <string>
using namespace std;
int main(void){
int i,u,j;
string a;
while(getline(cin,a)){
if(a==""){continue;}
i=0;
//cout<<a.length()<<endl;
while(i<a.length()){

// cout<<a.length()<<endl;1
for(u=i;a[u]!=' ' && u<=a ...
by thomas1016
Sat Jun 17, 2006 6:28 am
Forum: Volume 4 (400-499)
Topic: 443 - Humble Numbers
Replies: 82
Views: 18053

Can U explain what lead to this result???

:o
by thomas1016
Fri Jun 16, 2006 2:55 pm
Forum: Volume 4 (400-499)
Topic: 443 - Humble Numbers
Replies: 82
Views: 18053

443 WA

why did it gave me WA it is alright while num<100?
it seems logically right ,did it?



#include <iostream>
#include <cmath>
using namespace std;
int check(int);

int main(void){
unsigned long long int k,a,pa;
while(cin>>k){
pa=0;
a=2000000100;
if(k==0){break;
}
cout<<"The "<<k;
switch(k%10 ...
by thomas1016
Sun Jun 11, 2006 5:49 pm
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 21961

Excuese me but this time it turns out to be TLE

Excuese me but this time it turns out to be TLE. :-? :-?




#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int t2w(string);
int main(void){
string a,b,d,e;
//char *c,d[11];

int sum;





while(1){
if (!getline(cin,b,'\n')) break;
if (!getline(cin,a,'\n')) break ...
by thomas1016
Sat Jun 10, 2006 9:38 am
Forum: Volume 4 (400-499)
Topic: 412 - Pi
Replies: 104
Views: 30241

412 WA

It seems alright but I got WA.


#include <iostream>
#include <cmath>
//#include <ctype>
#include <iomanip>
using namespace std;
int gcd(int,int);
int main(void){
int a[50];
int k,u,j,t,m;
while(cin>>k){
if(k==0){
break;
}
m=0;
t=0;
for(u=0;u<k;cin>>a[u],u++);
// for(u=0;u<k;cout<<a[u ...
by thomas1016
Sat Jun 10, 2006 7:07 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 21961

Here is my code.
This time is WA.
HELP...
--------------
CPU Memory
9.725 476
---------------


#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int t2w(string);
int main(void){
string a,b,d,e;
//char *c,d[11];

int sum;





while(1){
if (!getline(cin,b)) break ...
by thomas1016
Sat Jun 10, 2006 6:36 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 21961

the input which has two space.
it means a 0.
by thomas1016
Sat Jun 10, 2006 6:34 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 21961

Thanks a lot.
May I ask u one more question???
in the following code
I can't correctlly get the input like "2 4 2 1 2"
how can i solve it??


.....

istringstream isss(a);
sum=0;
while(isss>>e){
sum=0;
istringstream iss(b);
while(iss>>d){
sum=sum*t2w(e)+t2w(d);
}
cout<<sum ...
by thomas1016
Sat Jun 10, 2006 6:15 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 21961

but how can I get the input
i can't use "cin" it has " " space in the input?
my program is stuck so it is TLE.
isn't "getline" is used to "get a line"??

Go to advanced search