Search found 25 matches

by jdmetz
Wed Aug 24, 2005 5:53 pm
Forum: Other words
Topic: e-mail submissions not working?
Replies: 3
Views: 2100

I don't know, because I rewrote my acmsubmit script to use curl and submit using the webform. There relevant part is here:

curl --silent --form paso=paso --form problem=$1 --form userid=$USERID --form language=$PLANG --form comment= --form code= --form "codefile=@$FNAME" http://acm.uva.es ...
by jdmetz
Mon Aug 15, 2005 3:26 pm
Forum: Volume 108 (10800-10899)
Topic: 10891 - Game of Sum
Replies: 33
Views: 18584

overflow?

Towhid wrote:Can someone provide some I/O for the this problem? My DP solution is getting WA. :(
Do you deal with overflow?

Input

Code: Select all

5
-2147483648 2147483647 -2147483648 2147483647 -2147483648
5
2147483647 2147483647 2147483647 2147483647 2147483647
0
Output

Code: Select all

2147483646
10737418235
by jdmetz
Fri Aug 12, 2005 2:12 pm
Forum: Volume 108 (10800-10899)
Topic: 10892 - LCM Cardinality
Replies: 25
Views: 13129

This problem can also be solved by the prime....solution...

Yes - the method I used, I don't even keep track of the prime factors. I just count how many of each one and compute the answer as I factor the number. That got me down to .004 seconds. To get to .002, I had to do my own input and output ...
by jdmetz
Thu Aug 11, 2005 5:03 pm
Forum: Volume 108 (10800-10899)
Topic: 10887 - Concatenation of Languages
Replies: 49
Views: 27052

try this

Input

Code: Select all

1
7 7

a
aa
aaa
aaaa
aaaaa
aaaaaa

a
aa
aaa
aaaa
aaaaa
aaaaaa
Output

Code: Select all

Case 1: 13
by jdmetz
Wed Aug 10, 2005 4:22 pm
Forum: Volume 108 (10800-10899)
Topic: 10892 - LCM Cardinality
Replies: 25
Views: 13129

Some trickier input

Input:

Code: Select all

1073741824
446185740
892371480
1784742960
1338557220
4656960
Output:

Code: Select all

1073741824 31
446185740 16403
892371480 22964
1784742960 29525
1338557220 27338
4656960 2048
by jdmetz
Tue Aug 09, 2005 4:29 pm
Forum: Volume 108 (10800-10899)
Topic: 10892 - LCM Cardinality
Replies: 25
Views: 13129

I think the output given above is wrong. Here is the output for that input from my AC program:

Code: Select all

2 2
12 8
1000000 85
12345676 68
87675612 23
1251562 41
9412 23
6537 5
123 5
12 8
3244 8
56342 41
1233 8
344333 14
98123 2
1 1
2 2
3 2
243 6
123999 5
by jdmetz
Mon Aug 08, 2005 5:55 pm
Forum: Volume 108 (10800-10899)
Topic: 10887 - Concatenation of Languages
Replies: 49
Views: 27052

abishek,

I figured it out - for at least one case, the first word in the first language is of length 0 - an emtpy line. scanf reads all whitespace when it encounters a space, tab, or newline in the format string, so we were skipping that new line.

I changed this part of my code: scanf("%d %d ", &m ...
by jdmetz
Mon Aug 08, 2005 3:48 pm
Forum: Volume 108 (10800-10899)
Topic: 10891 - Game of Sum
Replies: 33
Views: 18584

shamim is correct. Abednego's method gives an answer of -7, not 7.

oulongbin, both players play to get the maximum difference, so if A takes 7, B will take 4 and -10, leaving A with -20 so that B wins with -6 vs. -13. B wouldn't let A pick between -10 and -20 when B could have taken the -10 leaving ...
by jdmetz
Mon Aug 08, 2005 2:41 pm
Forum: Volume 108 (10800-10899)
Topic: 10887 - Concatenation of Languages
Replies: 49
Views: 27052

Could you show your code?

Ok, as it gets WA and would be too slow otherwise, I will.
#include <cstdio>
#include <vector>
#include <string>
#include <set>

using namespace std;

main() {
char sz[11];
int T, cs = 0;

scanf("%d ", &T);
while (T--) {
int m, n;

vector<string> a, b;

scanf ...
by jdmetz
Mon Aug 08, 2005 5:10 am
Forum: Volume 108 (10800-10899)
Topic: 10887 - Concatenation of Languages
Replies: 49
Views: 27052

how fast?

Someone who got AC, how fast does your program run on the input produced by this program?
#include <stdio.h>

main() {
int i, j;

char sz[11] = "aaaaaaaaaa";

puts("1\n1500 1500");

for (i = 0; i < 3000; i++) {
puts(sz);
j = 9;
while (sz[j] == 'z') sz[j--] = 'a';
sz[j]++;
}
}
by jdmetz
Mon Aug 08, 2005 4:49 am
Forum: Volume 108 (10800-10899)
Topic: 10887 - Concatenation of Languages
Replies: 49
Views: 27052

any tricky cases?

Are there any tricky cases? I'm getting WA after ~2.2s rather than TLE.

Here are my current test cases, which are fairly trivial to verify by hand:

input:
7
3 2
cat
dog
mouse
rat
bat
1 1
abc
cab
5 5
a
aa
aab
abc
ad
a
ab
b
bc
cd
3 3
a

b
a

b
0 0
1 1
a
b
10 0
a
b
c
d
e
f
g
h
i
j
output:
Case 1 ...
by jdmetz
Sun Aug 07, 2005 12:49 am
Forum: C
Topic: print long long
Replies: 2
Views: 3055

printf("%lld", result) is what you are looking for.
by jdmetz
Fri Aug 05, 2005 11:46 pm
Forum: Off topic (General chit-chat)
Topic: Access Denied?
Replies: 14
Views: 6751

got web submissions working for me

I found I still had the old homepage open with the Edit User Info link:

http://acm.uva.es/cgi-bin/OnlineJudge?UsersMgr:EditUser

I logged in and checked "allow submissions from any host" or whatever that option is. Now I can submit using the web form. 30 newly accepted problems for me today ...
by jdmetz
Wed Jul 27, 2005 3:24 am
Forum: Off topic (General chit-chat)
Topic: Access Denied?
Replies: 14
Views: 6751

e-mail submissions still not working for me

I think your problem is solved.
M i right? :)

Note for me :( I still get a single e-mail back (instead of received and status notifications) that says:

Dear jdmetz:


You only can submit problems from the web.

Please see http://acm.uva.es/problemset/submit.php
(or use alternatives like http ...
by jdmetz
Sat Jul 23, 2005 4:43 am
Forum: Off topic (General chit-chat)
Topic: Access Denied?
Replies: 14
Views: 6751

any news on e-mail submissions?

Any news on this, or any idea who I should check with? I have a bunch of problems I'm waiting to submit, but e-mail submissions still don't work.

Go to advanced search