UVA Problem # 686 ( Goldbach's Conjecture (II))


প্রবলেমটা খুব সহজ কিন্তু আমার বার বার runtime error দেখাইতেছিল মাথা নষ্ট হওয়ার মতো  অবস্থা পরে বুঝতে পারলাম আমার সিভের অ্যালগরিদমে prime Array ঠিক ভাবে declare করা হয় নাই কিন্তু আমি প্রথমেই ওইটাকে ঠিক ধরে নিয়ে বাকি গুলা চেক করছিলাম।
যাই হোক প্রবলেমটা সল্ভ করে মজা পাইছি
Solution টা ঠিক আছে নাকি -ইনপুট আউট চেক করার জন্য নিচের input-output গুলো ব্যাবহার করা যেতে পারে

input ---> output 

22292 ---> 177 
30000 ---> 602 
32000 ---> 312 
100 ---> 6 
20 ---> 2 
598 ---> 15
2222 ----> 35






Easy UVA Problem

Problem No      Problem Name
100The 3n+1 problem
102Ecological bin packing
113Power of cryptography
136Ugly numbers
190Circle through three points
264Count on Cantor
272TEX qoutes
299Train swapping
305Joseph
353Pesky Palindromes
369Combinations
382Perfection
401Palindromes
406Prime cuts
408Uniform generator
424Integer inquery
444Encoder and decoder
458The decoder
490Rotating sequences
492Pig latin
495Fibonacci freeze
499What’s the frequency, Kenneth?
530Binomial showdown
541Error correction
543Goldbach’s conjecture
579Clock Hands
591Box of Bricks
609DNA sorting
623500!
686Goldbach’s conjecture (II)
694The Collatz sequence
713Adding reversed numbers
729The Hamming distance problem
834Continued Fractions
10008What’s Cryptanalysis?
10013Super long sums
10018Reverse and Add
10019Funny Encryption Method
10035Primary Arithmetic
10055Hashmat the brave warrior
10062Tell me the frequencies!
10070Leap Year or Not Leap Year
10082WERTYU
10101Bangla numbers
10107What is the median?
10110Light more light
10161Ant on a Chessboard
10200Prime time
10235Simply Emirp
10242Fourth point!!
10252Common Permutation
10282Babel fish
10286Trouble with a pentagon
10300Ecological Premium
10302Summation of Polynomials
10323Factorial! You Must be Kidding!!!
10324Zeros and Ones
10327Flip sort
10370Above average
10409Die game
10420List of conquests
10424Love calculator
10432Polygon inside a circle
10473Simple base conversion
10515Powers et al.
10611The playboy chimp
10696f91
10700Camel trading


source : http://www.acmsolver.org/

URI Online Judge : Problem # 1044 (Multiples)

Problem Link : https://www.urionlinejudge.com.br/judge/en/problems/view/1044

URI Online Judge | 1044

Multiples

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Read two values (A and B). After, the program should print the message "Sao Multiplos" (are multiples) or"Nao sao Multiplos" (aren’t multiples), corresponding to the read values.

Input

The input has two integer numbers.

Output

Print the message relative to the input as stated above.
Sample InputSample Output
6 24Sao Multiplos


Solution : 



সিভের অ্যালগরিদম


দুইভাবে implement করছি একটা main ফাংশনে অপরটা user define function use করে








আরেকভাবে implement করছি সেটা হচ্ছে , একটা array তে প্রাইম নাম্বার গুলো বের করে আরেকটা array তে প্রাইম নাম্বার গুলো রাখছি। 




প্রোজেক্ট ইউলার প্রবলেম # 06

problem link (Sum square difference) 

Problem Description : 


The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)2 = 552 = 3025
Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.
Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.


খুবই বাংলা প্রবলেম ক্লাস 8/9 এর পোলাপানেরাও পারবে। n(n+1)/2 এই ফর্মুলা ব্যাবহার করা হইসে বাকিটা সহজ যে কেউ পড়লেই বুঝবে । 



প্রোজেক্ট ইউলার প্রবলেম # 07

 Problem Link: Project Euler Problem # 07 (10001st Prime) 

সিভের অ্যালগরিদম দিয়ে প্রবলেম টি সল্ভে করছি, তাই সিভের অ্যালগরিদম আগে শিখে নেন। প্রবলেমটির মাঝে কোন জটিলতা নাই খুবই সিম্পল প্রবলেম। কোডে যথেষ্ট পরিমাণ কমেন্ট-আউট করছি বোঝার সুবিধার জন্য।



প্রোজেক্ট ইউলার প্রবলেম 04

problem Link 

problem:

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.

বাংলা প্রবলেম, তবে একটা সমস্যা execution time অনেক বেড়ে যাবে যদি লুপ দিয়ে করেন। যাই হোক নিচের কোডটি যথেষ্ট efficient।



Uva : 10812 -- Beat The Spread!

Problem Link


সমস্যাটি সল্ভ করতে গিয়ে আমি যথেষ্ট পরিমাণ মজা পাইসি :D। প্রবলেমটির key word লেখা আসে একবারে লাস্টে। 
এখানে দুইটি কন্ডিশনকে Terminate করতে হবে প্রথমত, final scores must be non negative এবং দ্বিতীয়ত, পূর্ণ সংখ্যা হতে হবে।
প্রথম শর্তের জন্য (s>b) তাহলেই a=(s+d)/2 and b=(s-d)/2 positive হবে। 
অপর শর্তের জন্য, a and b দশমিক সংখ্যা হবে যখন   a and b এর মধ্যে একটি even and another must be odd number হবে। এজন্য (s+d)/2 কারন, দুটি বিজোড় সংখ্যার যোগফল সব সময় একটি জোড় সংখ্যা।

আমি মনে হয় ভালোভাবে গুছিয়ে লিখতে পারি নাই প্রবলেমটা ভালো মত পড়লেই পুরো বিষয়টা পরিষ্কার হয়ে যাবে।

Train Swapping Uva # 299

Problem Link

আমি প্রথমে বুঝতে পারি নাই এটি কি টাইপের প্রবলেম, পরে বুঝতে পারলাম এইটা সর্টিং প্রবলেম, যাই হোক আমার পর পর ৫টি সাবমিশন Error দেখালো। আমি বুঝতে পারতেসিলাম না আমার সমস্যা কোথায়। একটা সময় পর আমি বুঝতে পারলাম আমার সর্টিং অ্যালগরিদমটাই ঠিক নাই। তার মানে আমি আগে যে বাবল সর্টিং অ্যালগরিদম শিখছিলাম  সেটা ভুল ছিল :D ।