The problem appears in [url]http://acm.hnu.cn:8080/online/?action=problem&type=show&id=10475[\url]
Just very simple method, first I reverse the binary number. Then I fill the zero in the remaining...
Type: Posts; User: Mathsniper
The problem appears in [url]http://acm.hnu.cn:8080/online/?action=problem&type=show&id=10475[\url]
Just very simple method, first I reverse the binary number. Then I fill the zero in the remaining...
But I cannot call extending library. Because the online judge doesn't accept that. And my friend told me that I had solved this problem using the method I have mentioned above by pascal language. And...
sorry for my lazy habit and the wrong link. The problem is calcuating how often does the letter appear from A to Z. I don't know why I get the wrong answer. For example, I input the following data
...
I have spent lots of time to debug but no result get. Problem from http://acm.hnu.cn:8080/online/?action=problem&type=show&id=10190
My idea:
1) Calcuating the letter how often they appear.
2) Find...
I am doing a problem about calcuating first digit of a^p form(a and p are non-negative integer. The total length of a^p never exceed 200). a and p may be a very large number. So I wanna make variable...
oh!!!!!!!!!!!! you're right! I complie the code based on Linux gcc implementation. I think the online judge is based on Microsoft system. The code is pass. Thank everyone to help me.
? what do you mean? vart?
No, the data maynot be saved as buffer and print it at time.
I wrote it by pascal. It can pass. But C doesn't.
var t:int64;
n,j:longint;
begin
readln(n);
for j:=1 to n do
begin
I'm sorry I don't reply the post for a long time. After I edit the code, it cannot be passed.
#include <stdio.h>
#include <math.h>
int main()
{
int i, n;
long x, k;
who can know that what's the problem here?
thanks ssharish2005, I haven't throught that it will be crashed with C++ variaible name of operator.
char *p;
while (*p != '\n') p++;
*p = '\0';
Assume a[k] stands for "1" index. "1" will appear in 1,2, 4, 7, 11, 16, 22, 29,....
Which means a[k]=a[k-1]+k-1, so we can find that a[n]=(n-1)n/2 + 1. If we assume a[n] = k. Then we obtian...
I am doing a problem about http://acm.hnu.cn:8080/online/?action=problem&type=show&id=10238
I have uploaded it for many time but get WRONG ANSWER. So I hope someone can help me. This is my solution...
is there any efficent method to do it? for example,
5
false
7
false
9
true
49
thank Salem. I have other problem about passing by value of variable "operator" at function "void operation(char operator)". The output is very strange. It cannot display "+", "-" or "*" properly....
can I use strtok to read it easily? or other method?
For example, 1 2 3 * + 4 -. A space between two data(operand or operator).
How to read it step by step and save as a proper parameter? for example, I declare two variable `int operand; char...
I have fixed it. A few bugs here. But now it is correct.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))...
for example,
; : <------- Including space!
This is;av23afgg k;fg: k.!
output data
This
I use precision multiplication method to implement it. But when I input > 11, the answer is strange! I don't know where is the bugs... hope anyone can find it. Thanks.
#include <stdio.h>...
yes, dwks. I wanna change the order of arguments.
I have a problem about precision multiplication. The code I wrote below.
int charToInt(char x)
{ return (int)(x-'0'); }
char intToChar(int x)
{ return (char)(x+'0'); }
void reverse(char...
thank Salem!!! :)
How to do it in the simplest method?