Search found 10 matches

by ultima_key
Sat Jul 11, 2015 12:25 am
Forum: Volume 102 (10200-10299)
Topic: 10260 - Soundex
Replies: 30
Views: 10792

Re: 10260 - Soundex

I am getting wrong answer but I think I handled all the test cases correctly. Here is my code: // // soundex.cpp // // // Created by iOS Development on 7/10/15. // // #include <iostream> #include <map> #define c cin #define o cout #define el endl using namespace std; map<char,char> l; void sets(){ f...
by ultima_key
Mon Apr 14, 2014 5:19 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 78754

Re: 10038 - Jolly Jumpers

#include <bits/stdc++.h> #define ll long long int using namespace std; inline void fastRead_int(ll &x) { register ll c = getchar(); x = 0; ll neg = 0; for(; ((c<48 || c>57) && c != '-'); c = getchar()); if(c=='-') { neg = 1; c = getchar(); } for(; c>47 && c<58 ; c = getchar()) { x = (x<<1) + (x<<3)...
by ultima_key
Thu Apr 03, 2014 4:46 pm
Forum: Volume 6 (600-699)
Topic: 661 - Blowing Fuses
Replies: 67
Views: 20118

Re: 661 - Blowing Fuses

still getting WA. What could be the problem? Try running your code at least once and consider looking at it objectively. This thread has some test cases. Check your code output against what's available on the forums. So, you're no longer printing two lines at the end of the output but what do you t...
by ultima_key
Wed Apr 02, 2014 6:10 pm
Forum: Volume 7 (700-799)
Topic: 748 - Exponentiation
Replies: 26
Views: 8430

Re: 748 - Exponentiation

95.123 12 548815620517731830194541.899025343415715973535967221869852721 0.4321 20 0.00000005148554641076956121994511276767154838481760200726351203835429763013462401 5.1234 15 43992025569.928573701266488041146654993318703707511666295476720493953024 6.7592 9 29448126.764121021618164430206909037173276...
by ultima_key
Wed Apr 02, 2014 3:54 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 53588

Re: UVA 10070

You'll need to program a bigint mod function - search the web for examples. Or you could use Java's bigInteger. import java.math.*; import java.util.*; class Main{ public static void main(String[] args){ Scanner cin = new Scanner(System.in); BigInteger n; while(cin.hasNext()){ n = cin.nextBigIntege...
by ultima_key
Wed Apr 02, 2014 3:04 pm
Forum: Volume 6 (600-699)
Topic: 661 - Blowing Fuses
Replies: 67
Views: 20118

Re: 661 - Blowing Fuses

You're printing two blank lines at the end of the output. #include <iostream> #include <cstring> using namespace std; int main(){ long long n,m,c; int x=1; while(cin >> n >> m >> c){ if(n==0 && m==0 && c==0){ break; } long long amp[n], op[m]; bool swtch[n]; memset(swtch, false, sizeof(swtch)); for(...
by ultima_key
Sat Mar 29, 2014 12:43 pm
Forum: Volume 118 (11800-11899)
Topic: 11850 - Alaska
Replies: 32
Views: 10127

Re: 11850-Alaska

#include <iostream> #include <algorithm> using namespace std; int main(){ int s; while(cin >> s){ if(s == 0) break; int station[s]; bool conse = true; for(int i = 0; i < s; i++) cin >> station[i]; sort(station, station+s); for(int i = 0; i < s-1; i++){ if(abs(station[i]-station[i+1]) != 200){ conse...
by ultima_key
Sat Mar 29, 2014 12:40 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 53588

Re: UVA 10070

So I will create a char, say char num[1000000], but here's the question:

How will I be able to convert every character to an integer so that i could check it if it is leap year or huluculu or bulukulu. Sorry. I'm still a newbie programmer.
by ultima_key
Fri Mar 28, 2014 2:46 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 53588

Re: UVA 10070

#include <iostream> using namespace std; int main(){ long long year; while(cin >> year){ bool leap = false, huluculu = false, bulukulu = false; if(year%4 == 0 && year%400 == 0) leap = true; else if(year%100 == 0) leap = false; if(year%15 == 0) huluculu = true; if(year%55 == 0 && leap) bulukulu = tr...
by ultima_key
Tue Mar 25, 2014 12:53 pm
Forum: Volume 6 (600-699)
Topic: 661 - Blowing Fuses
Replies: 67
Views: 20118

Re: 661 - Blowing Fuses

#include <iostream> #include <cstring> using namespace std; int main(){ long long n,m,c; int x=1; while(cin >> n >> m >> c){ if(n==0 && m==0 && c==0){ cout << endl; break; } long long amp[n], op[m]; bool swtch[n]; memset(swtch, false, sizeof(swtch)); for(int i = 1; i <= n; i++) cin >> amp[i]; long ...

Go to advanced search