SlideShare a Scribd company logo
1 of 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);
+ }
+}

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 185Mahmoud 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 pythonIbrahim Kasim
 
Java8 stream
Java8 streamJava8 stream
Java8 streamkoji lin
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
Compiler basics: lisp to assembly
Compiler basics: lisp to assemblyCompiler basics: lisp to assembly
Compiler basics: lisp to assemblyPhil Eaton
 
Brief intro to clojure
Brief intro to clojureBrief intro to clojure
Brief intro to clojureRoy Rutto
 
Static Variable in C++
Static Variable in C++Static Variable in C++
Static Variable in C++Nasir Hamidon
 
GoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGautam 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 EverywhereKris 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 FosterNETWAYS
 
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

bee engaged with youth - World Bee Day 2024
bee engaged with youth - World Bee Day 2024bee engaged with youth - World Bee Day 2024
bee engaged with youth - World Bee Day 2024Christina Parmionova
 
Medieval Iraq Demographic Factors Yale Historical Review
Medieval Iraq Demographic Factors Yale Historical ReviewMedieval Iraq Demographic Factors Yale Historical Review
Medieval Iraq Demographic Factors Yale Historical Reviewyalehistoricalreview
 
#Bepartoftheplan on International Day For Biological Diversity 2024
#Bepartoftheplan on International Day For Biological Diversity 2024#Bepartoftheplan on International Day For Biological Diversity 2024
#Bepartoftheplan on International Day For Biological Diversity 2024Christina Parmionova
 
“Bee engaged with Youth”. World Bee Day 2024; May. 20th.
“Bee engaged with Youth”. World Bee Day 2024; May. 20th.“Bee engaged with Youth”. World Bee Day 2024; May. 20th.
“Bee engaged with Youth”. World Bee Day 2024; May. 20th.Christina Parmionova
 
Program Kickoff- Cohort 4______ (2).pptx
Program Kickoff- Cohort 4______ (2).pptxProgram Kickoff- Cohort 4______ (2).pptx
Program Kickoff- Cohort 4______ (2).pptxScottMeyers35
 
30th anniversary of the International Year of Families.
30th anniversary of the International Year of Families.30th anniversary of the International Year of Families.
30th anniversary of the International Year of Families.Christina Parmionova
 
Happy International Day of light - SPIE.
Happy International Day of light - SPIE.Happy International Day of light - SPIE.
Happy International Day of light - SPIE.Christina Parmionova
 
researching client.pptxffffffffffffffffffffffffff
researching client.pptxffffffffffffffffffffffffffresearching client.pptxffffffffffffffffffffffffff
researching client.pptxfffffffffffffffffffffffffflolsDocherty
 
International Day of Families - 15 May 2024 - UNDESA.
International Day of Families - 15 May 2024 - UNDESA.International Day of Families - 15 May 2024 - UNDESA.
International Day of Families - 15 May 2024 - UNDESA.Christina Parmionova
 
RPO America Peer Exchange: Rural Transportation Planning Programs
RPO America Peer Exchange: Rural Transportation Planning ProgramsRPO America Peer Exchange: Rural Transportation Planning Programs
RPO America Peer Exchange: Rural Transportation Planning ProgramsRPO America
 
Building a better Britain: How cities like Bradford can help to end economic ...
Building a better Britain: How cities like Bradford can help to end economic ...Building a better Britain: How cities like Bradford can help to end economic ...
Building a better Britain: How cities like Bradford can help to end economic ...ResolutionFoundation
 
16 may, International Day of Living together in peace 2024
16 may, International Day of Living together in peace 202416 may, International Day of Living together in peace 2024
16 may, International Day of Living together in peace 2024Christina Parmionova
 
Geate Advertising Agency by Slidesgo.pptx
Geate Advertising Agency by Slidesgo.pptxGeate Advertising Agency by Slidesgo.pptx
Geate Advertising Agency by Slidesgo.pptxnouralhuda2210173
 
“Be part of the Plan” International Day For Biological Diversity 2024.
“Be part of the Plan” International Day For Biological Diversity 2024.“Be part of the Plan” International Day For Biological Diversity 2024.
“Be part of the Plan” International Day For Biological Diversity 2024.Christina Parmionova
 
IEA Global Critical Minerals Outlook2024
IEA Global Critical Minerals Outlook2024IEA Global Critical Minerals Outlook2024
IEA Global Critical Minerals Outlook2024Energy for One World
 
Sponsoring a Girl Child's Education in kurnool
Sponsoring a Girl Child's Education in kurnoolSponsoring a Girl Child's Education in kurnool
Sponsoring a Girl Child's Education in kurnoolSERUDS INDIA
 
Inflation scarring: How has the cost-of-living crisis changed Britain?
Inflation scarring: How has the cost-of-living crisis changed Britain?Inflation scarring: How has the cost-of-living crisis changed Britain?
Inflation scarring: How has the cost-of-living crisis changed Britain?ResolutionFoundation
 

Recently uploaded (20)

bee engaged with youth - World Bee Day 2024
bee engaged with youth - World Bee Day 2024bee engaged with youth - World Bee Day 2024
bee engaged with youth - World Bee Day 2024
 
Medieval Iraq Demographic Factors Yale Historical Review
Medieval Iraq Demographic Factors Yale Historical ReviewMedieval Iraq Demographic Factors Yale Historical Review
Medieval Iraq Demographic Factors Yale Historical Review
 
#Bepartoftheplan on International Day For Biological Diversity 2024
#Bepartoftheplan on International Day For Biological Diversity 2024#Bepartoftheplan on International Day For Biological Diversity 2024
#Bepartoftheplan on International Day For Biological Diversity 2024
 
“Bee engaged with Youth”. World Bee Day 2024; May. 20th.
“Bee engaged with Youth”. World Bee Day 2024; May. 20th.“Bee engaged with Youth”. World Bee Day 2024; May. 20th.
“Bee engaged with Youth”. World Bee Day 2024; May. 20th.
 
Program Kickoff- Cohort 4______ (2).pptx
Program Kickoff- Cohort 4______ (2).pptxProgram Kickoff- Cohort 4______ (2).pptx
Program Kickoff- Cohort 4______ (2).pptx
 
30th anniversary of the International Year of Families.
30th anniversary of the International Year of Families.30th anniversary of the International Year of Families.
30th anniversary of the International Year of Families.
 
Happy International Day of light - SPIE.
Happy International Day of light - SPIE.Happy International Day of light - SPIE.
Happy International Day of light - SPIE.
 
researching client.pptxffffffffffffffffffffffffff
researching client.pptxffffffffffffffffffffffffffresearching client.pptxffffffffffffffffffffffffff
researching client.pptxffffffffffffffffffffffffff
 
How to Save a Place: How to Fund Your Preservation Project
How to Save a Place: How to Fund Your Preservation ProjectHow to Save a Place: How to Fund Your Preservation Project
How to Save a Place: How to Fund Your Preservation Project
 
International Day of Families - 15 May 2024 - UNDESA.
International Day of Families - 15 May 2024 - UNDESA.International Day of Families - 15 May 2024 - UNDESA.
International Day of Families - 15 May 2024 - UNDESA.
 
RPO America Peer Exchange: Rural Transportation Planning Programs
RPO America Peer Exchange: Rural Transportation Planning ProgramsRPO America Peer Exchange: Rural Transportation Planning Programs
RPO America Peer Exchange: Rural Transportation Planning Programs
 
07/03/2024 Publiekdomeindag - voormiddag
07/03/2024 Publiekdomeindag - voormiddag07/03/2024 Publiekdomeindag - voormiddag
07/03/2024 Publiekdomeindag - voormiddag
 
Building a better Britain: How cities like Bradford can help to end economic ...
Building a better Britain: How cities like Bradford can help to end economic ...Building a better Britain: How cities like Bradford can help to end economic ...
Building a better Britain: How cities like Bradford can help to end economic ...
 
16 may, International Day of Living together in peace 2024
16 may, International Day of Living together in peace 202416 may, International Day of Living together in peace 2024
16 may, International Day of Living together in peace 2024
 
Geate Advertising Agency by Slidesgo.pptx
Geate Advertising Agency by Slidesgo.pptxGeate Advertising Agency by Slidesgo.pptx
Geate Advertising Agency by Slidesgo.pptx
 
“Be part of the Plan” International Day For Biological Diversity 2024.
“Be part of the Plan” International Day For Biological Diversity 2024.“Be part of the Plan” International Day For Biological Diversity 2024.
“Be part of the Plan” International Day For Biological Diversity 2024.
 
IEA Global Critical Minerals Outlook2024
IEA Global Critical Minerals Outlook2024IEA Global Critical Minerals Outlook2024
IEA Global Critical Minerals Outlook2024
 
07/03/2024 Publiekdomeindag - namiddag
07/03/2024 Publiekdomeindag - namiddag07/03/2024 Publiekdomeindag - namiddag
07/03/2024 Publiekdomeindag - namiddag
 
Sponsoring a Girl Child's Education in kurnool
Sponsoring a Girl Child's Education in kurnoolSponsoring a Girl Child's Education in kurnool
Sponsoring a Girl Child's Education in kurnool
 
Inflation scarring: How has the cost-of-living crisis changed Britain?
Inflation scarring: How has the cost-of-living crisis changed Britain?Inflation scarring: How has the cost-of-living crisis changed Britain?
Inflation scarring: How has the cost-of-living crisis changed Britain?
 

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); + } +}