SlideShare a Scribd company logo
+/*
+ID: tippabh1
+LANG: JAVA
+PROG: ride
+*/
+
+import java.io.*;
+
+class ride {
+ public static void main (String [] args) throws IOException {
+ BufferedReader f = new BufferedReader(new FileReader("ride.in"));
+ PrintWriter out = new PrintWriter(new BufferedWriter(new
FileWriter("ride.out")));
+
+ String a = f.readLine();
+ String b = f.readLine();
+
+ String ref = "0ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ int apro = 1, bpro = 1;
+
+ for (int i = 0; i < a.length(); i++) apro *= ref.indexOf(a.charAt(i));
+ for (int i = 0; i < b.length(); i++) bpro *= ref.indexOf(b.charAt(i));
+
+ if (apro % 47 == bpro % 47) out.println("GO"); else
out.println("STAY");
+ out.close();
+ System.exit(0);
+ }
+}

More Related Content

What's hot

The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
Mahmoud Samir Fayed
 
CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)
Karan Bora
 
Python 如何執行
Python 如何執行Python 如何執行
Python 如何執行
kao kuo-tung
 
Garbage collector in python
Garbage collector in pythonGarbage collector in python
Garbage collector in python
Ibrahim Kasim
 
Exploiting vectorization with ISPC
Exploiting vectorization with ISPCExploiting vectorization with ISPC
Exploiting vectorization with ISPC
Roberto Agostino Vitillo
 
Rcpp11 genentech
Rcpp11 genentechRcpp11 genentech
Rcpp11 genentech
Romain Francois
 
Java8 stream
Java8 streamJava8 stream
Java8 stream
koji lin
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
Chris Ohk
 
R/C++ talk at earl 2014
R/C++ talk at earl 2014R/C++ talk at earl 2014
R/C++ talk at earl 2014
Romain Francois
 
Compiler basics: lisp to assembly
Compiler basics: lisp to assemblyCompiler basics: lisp to assembly
Compiler basics: lisp to assembly
Phil Eaton
 
Brief intro to clojure
Brief intro to clojureBrief intro to clojure
Brief intro to clojure
Roy Rutto
 
Queue oop
Queue   oopQueue   oop
Queue oop
Gouda Mando
 
Static Variable in C++
Static Variable in C++Static Variable in C++
Static Variable in C++
Nasir Hamidon
 
Import
ImportImport
GoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPH
Gautam Rege
 
Why is a[1] fast than a.get(1)
Why is a[1]  fast than a.get(1)Why is a[1]  fast than a.get(1)
Why is a[1] fast than a.get(1)
kao kuo-tung
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
princy75
 
CommonJS: JavaScript Everywhere
CommonJS: JavaScript EverywhereCommonJS: JavaScript Everywhere
CommonJS: JavaScript Everywhere
Kris Kowal
 
OSMC 2014: Introduction into collectd | Florian Foster
OSMC 2014: Introduction into collectd | Florian FosterOSMC 2014: Introduction into collectd | Florian Foster
OSMC 2014: Introduction into collectd | Florian Foster
NETWAYS
 
BT-led점등
BT-led점등BT-led점등
BT-led점등
InHee Kim
 

What's hot (20)

The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
 
CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)
 
Python 如何執行
Python 如何執行Python 如何執行
Python 如何執行
 
Garbage collector in python
Garbage collector in pythonGarbage collector in python
Garbage collector in python
 
Exploiting vectorization with ISPC
Exploiting vectorization with ISPCExploiting vectorization with ISPC
Exploiting vectorization with ISPC
 
Rcpp11 genentech
Rcpp11 genentechRcpp11 genentech
Rcpp11 genentech
 
Java8 stream
Java8 streamJava8 stream
Java8 stream
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
R/C++ talk at earl 2014
R/C++ talk at earl 2014R/C++ talk at earl 2014
R/C++ talk at earl 2014
 
Compiler basics: lisp to assembly
Compiler basics: lisp to assemblyCompiler basics: lisp to assembly
Compiler basics: lisp to assembly
 
Brief intro to clojure
Brief intro to clojureBrief intro to clojure
Brief intro to clojure
 
Queue oop
Queue   oopQueue   oop
Queue oop
 
Static Variable in C++
Static Variable in C++Static Variable in C++
Static Variable in C++
 
Import
ImportImport
Import
 
GoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPH
 
Why is a[1] fast than a.get(1)
Why is a[1]  fast than a.get(1)Why is a[1]  fast than a.get(1)
Why is a[1] fast than a.get(1)
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
 
CommonJS: JavaScript Everywhere
CommonJS: JavaScript EverywhereCommonJS: JavaScript Everywhere
CommonJS: JavaScript Everywhere
 
OSMC 2014: Introduction into collectd | Florian Foster
OSMC 2014: Introduction into collectd | Florian FosterOSMC 2014: Introduction into collectd | Florian Foster
OSMC 2014: Introduction into collectd | Florian Foster
 
BT-led점등
BT-led점등BT-led점등
BT-led점등
 

Recently uploaded

PUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptx
PUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptxPUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptx
PUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptx
Marked12
 
Item # 10 -- Historical Presv. Districts
Item # 10 -- Historical Presv. DistrictsItem # 10 -- Historical Presv. Districts
Item # 10 -- Historical Presv. Districts
ahcitycouncil
 
Milton Keynes Hospital Charity - A guide to leaving a gift in your Will
Milton Keynes Hospital Charity - A guide to leaving a gift in your WillMilton Keynes Hospital Charity - A guide to leaving a gift in your Will
Milton Keynes Hospital Charity - A guide to leaving a gift in your Will
fundraising4
 
Item #s 8&9 -- Demolition Code Amendment
Item #s 8&9 -- Demolition Code AmendmentItem #s 8&9 -- Demolition Code Amendment
Item #s 8&9 -- Demolition Code Amendment
ahcitycouncil
 
A Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC Charlotte
A Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC CharlotteA Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC Charlotte
A Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC Charlotte
Cori Faklaris
 
Antyodaya saral portal haryana govt schemes
Antyodaya saral portal haryana govt schemesAntyodaya saral portal haryana govt schemes
Antyodaya saral portal haryana govt schemes
narinav14
 
Border towns and spaces of (in)visibility.pdf
Border towns and spaces of (in)visibility.pdfBorder towns and spaces of (in)visibility.pdf
Border towns and spaces of (in)visibility.pdf
Scalabrini Institute for Human Mobility in Africa
 
Abiy Berehe - Texas Commission on Environmental Quality Updates
Abiy Berehe - Texas Commission on Environmental Quality UpdatesAbiy Berehe - Texas Commission on Environmental Quality Updates
Abiy Berehe - Texas Commission on Environmental Quality Updates
Texas Alliance of Groundwater Districts
 
原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样
原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样
原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样
ii2sh2v
 
Indira awas yojana housing scheme renamed as PMAY
Indira awas yojana housing scheme renamed as PMAYIndira awas yojana housing scheme renamed as PMAY
Indira awas yojana housing scheme renamed as PMAY
narinav14
 
2024: The FAR - Federal Acquisition Regulations, Part 40
2024: The FAR - Federal Acquisition Regulations, Part 402024: The FAR - Federal Acquisition Regulations, Part 40
2024: The FAR - Federal Acquisition Regulations, Part 40
JSchaus & Associates
 
World Food Safety Day 2024- Communication-toolkit.
World Food Safety Day 2024- Communication-toolkit.World Food Safety Day 2024- Communication-toolkit.
World Food Safety Day 2024- Communication-toolkit.
Christina Parmionova
 
PPT Item # 4 - 434 College Blvd. (sign. review)
PPT Item # 4 - 434 College Blvd. (sign. review)PPT Item # 4 - 434 College Blvd. (sign. review)
PPT Item # 4 - 434 College Blvd. (sign. review)
ahcitycouncil
 
Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...
Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...
Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...
ssuser05e8f3
 
RFP for Reno's Community Assistance Center
RFP for Reno's Community Assistance CenterRFP for Reno's Community Assistance Center
RFP for Reno's Community Assistance Center
This Is Reno
 
原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样
原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样
原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样
yemqpj
 
AHMR volume 10 number 1 January-April 2024
AHMR volume 10 number 1 January-April 2024AHMR volume 10 number 1 January-April 2024
AHMR volume 10 number 1 January-April 2024
Scalabrini Institute for Human Mobility in Africa
 
CFYT Rolling Ads Dawson City Yukon Canada
CFYT Rolling Ads Dawson City Yukon CanadaCFYT Rolling Ads Dawson City Yukon Canada
CFYT Rolling Ads Dawson City Yukon Canada
pmenzies
 
A proposed request for information on LIHTC
A proposed request for information on LIHTCA proposed request for information on LIHTC
A proposed request for information on LIHTC
Roger Valdez
 
Circular Economy implementation in the EU
Circular Economy implementation in the EUCircular Economy implementation in the EU
Circular Economy implementation in the EU
HasanHamdan9
 

Recently uploaded (20)

PUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptx
PUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptxPUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptx
PUBLIC FINANCIAL MANAGEMENT SYSTEM (PFMS) and DBT.pptx
 
Item # 10 -- Historical Presv. Districts
Item # 10 -- Historical Presv. DistrictsItem # 10 -- Historical Presv. Districts
Item # 10 -- Historical Presv. Districts
 
Milton Keynes Hospital Charity - A guide to leaving a gift in your Will
Milton Keynes Hospital Charity - A guide to leaving a gift in your WillMilton Keynes Hospital Charity - A guide to leaving a gift in your Will
Milton Keynes Hospital Charity - A guide to leaving a gift in your Will
 
Item #s 8&9 -- Demolition Code Amendment
Item #s 8&9 -- Demolition Code AmendmentItem #s 8&9 -- Demolition Code Amendment
Item #s 8&9 -- Demolition Code Amendment
 
A Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC Charlotte
A Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC CharlotteA Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC Charlotte
A Guide to AI for Smarter Nonprofits - Dr. Cori Faklaris, UNC Charlotte
 
Antyodaya saral portal haryana govt schemes
Antyodaya saral portal haryana govt schemesAntyodaya saral portal haryana govt schemes
Antyodaya saral portal haryana govt schemes
 
Border towns and spaces of (in)visibility.pdf
Border towns and spaces of (in)visibility.pdfBorder towns and spaces of (in)visibility.pdf
Border towns and spaces of (in)visibility.pdf
 
Abiy Berehe - Texas Commission on Environmental Quality Updates
Abiy Berehe - Texas Commission on Environmental Quality UpdatesAbiy Berehe - Texas Commission on Environmental Quality Updates
Abiy Berehe - Texas Commission on Environmental Quality Updates
 
原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样
原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样
原版制作(Hope毕业证书)利物浦霍普大学毕业证文凭证书一模一样
 
Indira awas yojana housing scheme renamed as PMAY
Indira awas yojana housing scheme renamed as PMAYIndira awas yojana housing scheme renamed as PMAY
Indira awas yojana housing scheme renamed as PMAY
 
2024: The FAR - Federal Acquisition Regulations, Part 40
2024: The FAR - Federal Acquisition Regulations, Part 402024: The FAR - Federal Acquisition Regulations, Part 40
2024: The FAR - Federal Acquisition Regulations, Part 40
 
World Food Safety Day 2024- Communication-toolkit.
World Food Safety Day 2024- Communication-toolkit.World Food Safety Day 2024- Communication-toolkit.
World Food Safety Day 2024- Communication-toolkit.
 
PPT Item # 4 - 434 College Blvd. (sign. review)
PPT Item # 4 - 434 College Blvd. (sign. review)PPT Item # 4 - 434 College Blvd. (sign. review)
PPT Item # 4 - 434 College Blvd. (sign. review)
 
Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...
Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...
Bangladesh studies presentation on Liberation War 1971 Indepence-of-Banglades...
 
RFP for Reno's Community Assistance Center
RFP for Reno's Community Assistance CenterRFP for Reno's Community Assistance Center
RFP for Reno's Community Assistance Center
 
原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样
原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样
原版制作(DPU毕业证书)德保罗大学毕业证Offer一模一样
 
AHMR volume 10 number 1 January-April 2024
AHMR volume 10 number 1 January-April 2024AHMR volume 10 number 1 January-April 2024
AHMR volume 10 number 1 January-April 2024
 
CFYT Rolling Ads Dawson City Yukon Canada
CFYT Rolling Ads Dawson City Yukon CanadaCFYT Rolling Ads Dawson City Yukon Canada
CFYT Rolling Ads Dawson City Yukon Canada
 
A proposed request for information on LIHTC
A proposed request for information on LIHTCA proposed request for information on LIHTC
A proposed request for information on LIHTC
 
Circular Economy implementation in the EU
Circular Economy implementation in the EUCircular Economy implementation in the EU
Circular Economy implementation in the EU
 

Test

  • 1. +/* +ID: tippabh1 +LANG: JAVA +PROG: ride +*/ + +import java.io.*; + +class ride { + public static void main (String [] args) throws IOException { + BufferedReader f = new BufferedReader(new FileReader("ride.in")); + PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("ride.out"))); + + String a = f.readLine(); + String b = f.readLine(); + + String ref = "0ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int apro = 1, bpro = 1; + + for (int i = 0; i < a.length(); i++) apro *= ref.indexOf(a.charAt(i)); + for (int i = 0; i < b.length(); i++) bpro *= ref.indexOf(b.charAt(i)); + + if (apro % 47 == bpro % 47) out.println("GO"); else out.println("STAY"); + out.close(); + System.exit(0); + } +}