SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
ACMACMACMACMACMACMACMA
CMACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
        ACM Training Session
MACMACMACMACMACMACMAC
          BRAC UNIVERSITY

MACMACMACMACMACMACMAC          2/11/2012

                           Raduan & Mahbub



MACMACMACMACMACMACMAC
        This work is licensed under a Creative Commons Attribution-


MACMACMACMACMACMACMAC
             NonCommercial-ShareAlike 3.0 Unported License.




MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
MACMACMACMACMACMACMAC
Page 1 of 6


                                       Association of Computing Machinery (ACM)


How to Start

   1.   Online judge like UVA, TJU, HDU, Top Coder (TC) etc [Register]

   2.   Try the simpler one then step by step (USACO)

   3.   Learn Data Structures (Built in) [in some case you have to implement your own Data Structure]

   4.   Learn Algorithms (read books, watch video on YouTube etc)

   5.   Participate in Programming Contest

   6.   First do it on paper then start coding (think just don’t jump on the problem)

   7.   Keep it Simple (KIS)

   8.   If not getting AC try another one don’t waste time




Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
Page 2 of 6


Contest Basic Terms

   1. AC = Accepted (No error :-))

   2. WA = Wrong Answer (Spelling Problem, Wrong Algorithm, Over-flow, Missing Corner Cases,
        Misread, Lexicographical answer)

   3. RE = Run Time Error (Array Index Out of Bound, Dividing by zero etc.)

   4. TLE = Time Limit Exceed (Weak Algorithm, Infinity Loop)

   5. MLE = Memory Limit Exceed (Defining 2DArray of Size>1000)

   6. PE = Presentation Error (Spacing Problem)

   7. CE = Compile Error (Using variables without defining)

Common Errors

   1.   Overflow

   2.   Run Time Error

   3.   0-1 indexing

   4.   For floating calculation remember the following things

                          [Integer division][Yields wa]


                       = 1.5714285714285714 [                    ]


Types of Problems

   1.   Adhoc

   2.   Graph

   3.   Geometry

   4.   Number Theory

   5.   Numerical Methods

   6.   Dynamic Programming

   7.   Greedy

   8.   String Matching

   9.   Sorting and Searching

   10. Combinatorics

   11. etc




Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
Page 3 of 6


      Algorithms: (Only discussion topic)

      Data Structures: 2D array, Recursion

      String: Input Parsing, String Tokenizer.

      Number Theory: GCD, LCM, Prime Check, Pre-Generating Prime (Sieve), Number of Divisors, Sum

       of Divisor etc.

      Geometry: Using mathematical built in function, Equality checking for double, in circle, Ex-circle,

       Area of Polygon, Points in (Rectangle, Circle, and Triangle)




Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
Page 4 of 6


Types of input in JAVA for ACM
      Scanner sc = new Scanner (System.in);

      /* Blank line Style input
                                                                    12
      String line;
                                                                     3
      while(true) {
                                                                    34
      line = sc.nextLine ();
                                                                    323
      if(line.equals(""))
                                                                <Blank line>
      break;

      */

                                                                     4

      /* TEST CASE Style input                                     BRAC

      int T = sc.nextInt();                                     PRANGON
      while(T-- > 0) {
                                                                   CAFE
      }
                                                                    CSE
      */



                                                                   BRAC
      /* EOF Style input

      while(hasNextLine()) {                                    PRANGON

      }                                                            CAFE

      */                                                            CSE

                                                                    EOF
      /* Sentinel Style input

      int SENTINEL = -1;                                           BRAC
      while(true) {
                                                                PRANGON
      int n = sc.nextInt();
                                                                   CAFE
      if(n == SENTINEL)
                                                                    CSE
      break;
                                                                    -1
      }

      */




Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
Page 5 of 6


Books

   1.    Art of programming contest by Ahmed Shamsul Arefin.
   2.    How to solve it by Computers by R.G.Dromey
   3.    Java How to Program
   4.    Competitive Programming 2: This increases the lower bound of Programming Contests. Again by
         Steven Halim and Felix Halim [http://uhunt.felix-halim.net/id/339]


Links of Online Judge

   1.    http://acm.tju.edu.cn/toj/
   2.    http://uva.onlinejudge.org/
   3.    http://ace.delos.com/usacogate
   4.    http://www.topcoder.com/
   5.    http://www.spoj.pl/
   6.    http://www.codechef.com/
   7.    http://campion.edu.ro/arhiva/
   8.    http://acm.fzu.edu.cn/index.php
   9.    http://acm.hit.edu.cn/index.php
   10.   http://infoarena.ro/
   11.   http://acm.lviv.ua/fusion/news.php
   12.   http://acm.mipt.ru/judge/login.pl?lang=en
   13.   http://acm.pku.edu.cn/JudgeOnline/
   14.   http://acm.sgu.ru/
   15.   http://acm.timus.ru/
   16.   http://acm.zju.edu.cn/onlinejudge/
   17.   http://acm.hdu.edu.cn/




Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
Page 6 of 6


 A "Theorem": All odd numbers is a prime
 Taken from Prof Leong Hong Wai joke during CS1305 lecture.

 Mathematician:
 3 prime, 5 prime, 7 prime, 9 not prime... aha!!! Therefore this theorem is false.

 Physicist:
 3 prime, 5 prime, 7 prime, 9 OOPS experimental error, ignore this, 11 prime, 13 prime, this theorem
 is true

 Engineer:
 3 prime, 5 prime, 7 prime, 9 prime, 11 prime, 13 prime, hmm.. nothing wrong here, this theorem is
 true.

 Computer Scientist:
 3 prime, 5 prime, 7 prime, 7 prime, 7 prime, 7 prime, 7 prime, 7 prime (Infinite loop :-).




Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)

Contenu connexe

Similaire à Buacm 1

AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...
AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...
AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...IAEME Publication
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8Rafael Casuso Romate
 
16. Java stacks and queues
16. Java stacks and queues16. Java stacks and queues
16. Java stacks and queuesIntro C# Book
 
ch04-conditional-execution.ppt
ch04-conditional-execution.pptch04-conditional-execution.ppt
ch04-conditional-execution.pptMahyuddin8
 
Network security mannual (2)
Network security mannual (2)Network security mannual (2)
Network security mannual (2)Vivek Kumar Sinha
 
C vs Java: Finding Prime Numbers
C vs Java: Finding Prime NumbersC vs Java: Finding Prime Numbers
C vs Java: Finding Prime NumbersAdam Feldscher
 
Advanced patterns in asynchronous programming
Advanced patterns in asynchronous programmingAdvanced patterns in asynchronous programming
Advanced patterns in asynchronous programmingMichael Arenzon
 
CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018Scilab
 
Team-2_NetworkPentaZone Mid project.pptx
Team-2_NetworkPentaZone Mid project.pptxTeam-2_NetworkPentaZone Mid project.pptx
Team-2_NetworkPentaZone Mid project.pptxTasnim
 
manual-pe-2017_compress.pdf
manual-pe-2017_compress.pdfmanual-pe-2017_compress.pdf
manual-pe-2017_compress.pdfAbdo Brahmi
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfSyed Mustafa
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldYura Nosenko
 
Specification-Based Test Program Generation for ARM VMSAv8-64 MMUs
Specification-Based Test Program Generation for ARM VMSAv8-64 MMUsSpecification-Based Test Program Generation for ARM VMSAv8-64 MMUs
Specification-Based Test Program Generation for ARM VMSAv8-64 MMUsAlexander Kamkin
 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Yulia Tsisyk
 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net PerformanceCUSTIS
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLDatabricks
 
Class 16: Making Loops
Class 16: Making LoopsClass 16: Making Loops
Class 16: Making LoopsDavid Evans
 
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...FarhanAhmade
 
Gssl
GsslGssl
Gsslncct
 

Similaire à Buacm 1 (20)

AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...
AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...
AN EFFICIENT ALGORITHM FOR WRAPPER AND TAM CO-OPTIMIZATION TO REDUCE TEST APP...
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8
 
16. Java stacks and queues
16. Java stacks and queues16. Java stacks and queues
16. Java stacks and queues
 
ch04-conditional-execution.ppt
ch04-conditional-execution.pptch04-conditional-execution.ppt
ch04-conditional-execution.ppt
 
Network security mannual (2)
Network security mannual (2)Network security mannual (2)
Network security mannual (2)
 
C vs Java: Finding Prime Numbers
C vs Java: Finding Prime NumbersC vs Java: Finding Prime Numbers
C vs Java: Finding Prime Numbers
 
Advanced patterns in asynchronous programming
Advanced patterns in asynchronous programmingAdvanced patterns in asynchronous programming
Advanced patterns in asynchronous programming
 
CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018
 
Team-2_NetworkPentaZone Mid project.pptx
Team-2_NetworkPentaZone Mid project.pptxTeam-2_NetworkPentaZone Mid project.pptx
Team-2_NetworkPentaZone Mid project.pptx
 
manual-pe-2017_compress.pdf
manual-pe-2017_compress.pdfmanual-pe-2017_compress.pdf
manual-pe-2017_compress.pdf
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 world
 
Lab
LabLab
Lab
 
Specification-Based Test Program Generation for ARM VMSAv8-64 MMUs
Specification-Based Test Program Generation for ARM VMSAv8-64 MMUsSpecification-Based Test Program Generation for ARM VMSAv8-64 MMUs
Specification-Based Test Program Generation for ARM VMSAv8-64 MMUs
 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"
 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net Performance
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQL
 
Class 16: Making Loops
Class 16: Making LoopsClass 16: Making Loops
Class 16: Making Loops
 
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
 
Gssl
GsslGssl
Gssl
 

Plus de Lifeparticle

Tech Talk: App Functionality (Android)
Tech Talk: App Functionality (Android)Tech Talk: App Functionality (Android)
Tech Talk: App Functionality (Android)Lifeparticle
 
Android security and parsing 101
Android security  and parsing  101Android security  and parsing  101
Android security and parsing 101Lifeparticle
 
Android SMS (GDayX, Dhaka, Bangladesh)
Android SMS (GDayX, Dhaka, Bangladesh)Android SMS (GDayX, Dhaka, Bangladesh)
Android SMS (GDayX, Dhaka, Bangladesh)Lifeparticle
 
WorkShop on Arduino
WorkShop on Arduino WorkShop on Arduino
WorkShop on Arduino Lifeparticle
 
Icpc team registration guide for coach
Icpc team registration guide for coachIcpc team registration guide for coach
Icpc team registration guide for coachLifeparticle
 

Plus de Lifeparticle (12)

Ruby talk
Ruby talkRuby talk
Ruby talk
 
Tech Talk: App Functionality (Android)
Tech Talk: App Functionality (Android)Tech Talk: App Functionality (Android)
Tech Talk: App Functionality (Android)
 
Android security and parsing 101
Android security  and parsing  101Android security  and parsing  101
Android security and parsing 101
 
All about android
All about androidAll about android
All about android
 
Android SMS (GDayX, Dhaka, Bangladesh)
Android SMS (GDayX, Dhaka, Bangladesh)Android SMS (GDayX, Dhaka, Bangladesh)
Android SMS (GDayX, Dhaka, Bangladesh)
 
WorkShop on Arduino
WorkShop on Arduino WorkShop on Arduino
WorkShop on Arduino
 
Command line
Command lineCommand line
Command line
 
Buacm 2
Buacm 2Buacm 2
Buacm 2
 
Buacm 3
Buacm 3Buacm 3
Buacm 3
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Icpc team registration guide for coach
Icpc team registration guide for coachIcpc team registration guide for coach
Icpc team registration guide for coach
 
Workshop on python
Workshop on pythonWorkshop on python
Workshop on python
 

Buacm 1

  • 1. ACMACMACMACMACMACMACMA CMACMACMACMACMACMACMAC MACMACMACMACMACMACMAC ACM Training Session MACMACMACMACMACMACMAC BRAC UNIVERSITY MACMACMACMACMACMACMAC 2/11/2012 Raduan & Mahbub MACMACMACMACMACMACMAC This work is licensed under a Creative Commons Attribution- MACMACMACMACMACMACMAC NonCommercial-ShareAlike 3.0 Unported License. MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC MACMACMACMACMACMACMAC
  • 2. Page 1 of 6 Association of Computing Machinery (ACM) How to Start 1. Online judge like UVA, TJU, HDU, Top Coder (TC) etc [Register] 2. Try the simpler one then step by step (USACO) 3. Learn Data Structures (Built in) [in some case you have to implement your own Data Structure] 4. Learn Algorithms (read books, watch video on YouTube etc) 5. Participate in Programming Contest 6. First do it on paper then start coding (think just don’t jump on the problem) 7. Keep it Simple (KIS) 8. If not getting AC try another one don’t waste time Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
  • 3. Page 2 of 6 Contest Basic Terms 1. AC = Accepted (No error :-)) 2. WA = Wrong Answer (Spelling Problem, Wrong Algorithm, Over-flow, Missing Corner Cases, Misread, Lexicographical answer) 3. RE = Run Time Error (Array Index Out of Bound, Dividing by zero etc.) 4. TLE = Time Limit Exceed (Weak Algorithm, Infinity Loop) 5. MLE = Memory Limit Exceed (Defining 2DArray of Size>1000) 6. PE = Presentation Error (Spacing Problem) 7. CE = Compile Error (Using variables without defining) Common Errors 1. Overflow 2. Run Time Error 3. 0-1 indexing 4. For floating calculation remember the following things [Integer division][Yields wa] = 1.5714285714285714 [ ] Types of Problems 1. Adhoc 2. Graph 3. Geometry 4. Number Theory 5. Numerical Methods 6. Dynamic Programming 7. Greedy 8. String Matching 9. Sorting and Searching 10. Combinatorics 11. etc Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
  • 4. Page 3 of 6  Algorithms: (Only discussion topic)  Data Structures: 2D array, Recursion  String: Input Parsing, String Tokenizer.  Number Theory: GCD, LCM, Prime Check, Pre-Generating Prime (Sieve), Number of Divisors, Sum of Divisor etc.  Geometry: Using mathematical built in function, Equality checking for double, in circle, Ex-circle, Area of Polygon, Points in (Rectangle, Circle, and Triangle) Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
  • 5. Page 4 of 6 Types of input in JAVA for ACM Scanner sc = new Scanner (System.in); /* Blank line Style input 12 String line; 3 while(true) { 34 line = sc.nextLine (); 323 if(line.equals("")) <Blank line> break; */ 4 /* TEST CASE Style input BRAC int T = sc.nextInt(); PRANGON while(T-- > 0) { CAFE } CSE */ BRAC /* EOF Style input while(hasNextLine()) { PRANGON } CAFE */ CSE EOF /* Sentinel Style input int SENTINEL = -1; BRAC while(true) { PRANGON int n = sc.nextInt(); CAFE if(n == SENTINEL) CSE break; -1 } */ Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
  • 6. Page 5 of 6 Books 1. Art of programming contest by Ahmed Shamsul Arefin. 2. How to solve it by Computers by R.G.Dromey 3. Java How to Program 4. Competitive Programming 2: This increases the lower bound of Programming Contests. Again by Steven Halim and Felix Halim [http://uhunt.felix-halim.net/id/339] Links of Online Judge 1. http://acm.tju.edu.cn/toj/ 2. http://uva.onlinejudge.org/ 3. http://ace.delos.com/usacogate 4. http://www.topcoder.com/ 5. http://www.spoj.pl/ 6. http://www.codechef.com/ 7. http://campion.edu.ro/arhiva/ 8. http://acm.fzu.edu.cn/index.php 9. http://acm.hit.edu.cn/index.php 10. http://infoarena.ro/ 11. http://acm.lviv.ua/fusion/news.php 12. http://acm.mipt.ru/judge/login.pl?lang=en 13. http://acm.pku.edu.cn/JudgeOnline/ 14. http://acm.sgu.ru/ 15. http://acm.timus.ru/ 16. http://acm.zju.edu.cn/onlinejudge/ 17. http://acm.hdu.edu.cn/ Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)
  • 7. Page 6 of 6 A "Theorem": All odd numbers is a prime Taken from Prof Leong Hong Wai joke during CS1305 lecture. Mathematician: 3 prime, 5 prime, 7 prime, 9 not prime... aha!!! Therefore this theorem is false. Physicist: 3 prime, 5 prime, 7 prime, 9 OOPS experimental error, ignore this, 11 prime, 13 prime, this theorem is true Engineer: 3 prime, 5 prime, 7 prime, 9 prime, 11 prime, 13 prime, hmm.. nothing wrong here, this theorem is true. Computer Scientist: 3 prime, 5 prime, 7 prime, 7 prime, 7 prime, 7 prime, 7 prime, 7 prime (Infinite loop :-). Raduanul Islam (10101024) & S. Mahbub – Uz – Zaman (09301004)