Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 2 |
ответ | Богдан | 1877. Велосипедные коды | 17 дек 2018 19:29 | 1 |
ответ Богдан 17 дек 2018 19:29 a=int(input()) b=int(input()) if (a%2) == 0 or (b%2) == 1: print('yes') else: print('no') |
памагите help | Богдан | 1877. Велосипедные коды | 5 июн 2020 20:58 | 3 |
плиз напишите решение задачи 1877. Велосипедные коды please help piton 3.6 Edited by author 17.12.2018 19:09 Not piton, python ;) Я на Python решил (decide), а на плюсах(C++) то же решение не заходит(don`t work) Действительно, на С++ не проходит решение. Ни так ни сяк. |
Accepted | mylyt | 1877. Велосипедные коды | 17 ноя 2018 19:56 | 1 |
/* by thinking the combinations of the two locks,we get if the password number for lock1 is even or password number for lock2 is odd, the theif could open the lock. I guess that would be the easiest ideal,right? */ #include <iostream> using namespace std; int main() { int lock1, lock2; cin >>lock1 >>lock2; if (lock1 % 2 == 0 || lock2 % 2 != 0) cout << "yes" << endl; else cout << "no" << endl; return 0; } |
Please help) | AndriyKozak | 1877. Велосипедные коды | 2 окт 2018 10:10 | 2 |
#include <stdio.h> int main() { char a[3],b[3]; gets(a); gets(b); int x; if (a[3]=='0'||a[3]=='2'||a[3]=='4'||a[3]=='6'||a[3]=='8') x=1; if (b[3]=='1'||b[3]=='3'||b[3]=='5'||b[3]=='7'||b[3]=='9') x=1; if(x==1) printf("yes"); else printf("no"); } The two codes are just two numbers, think about it this way. If I write more, the solution will be obvious and you will get nothing. |
Blya poconi daite cod plez | Rustam_True_Proger | 1877. Велосипедные коды | 14 сен 2017 19:43 | 2 |
|
Wrong Answer (C). Which reason? | exe-cute-er | 1877. Велосипедные коды | 19 июл 2017 23:43 | 2 |
#include <stdio.h> int main() { int a, b; scanf("%d %d", &a, &b); if (a % 2 == 0 || b % 2 != 0) { printf("YES"); } else { printf("NO"); } return 0; } Posted by Deepto Shome Pritom 4 Feb 2017 21:06 Test 1: Den's keys: 0001 0000 1st night 2nd night 3rd night 4th night ... ... ... All nights bike's key 0001 0000 0001 0000 - bad man 0000 0001 0003 0004 - result no no no no no Test 2: Den's keys: 0002 0001 1st night 2nd night 3rd night 4th night ... ... ... All nights bike's key 0002 0001 0002 0001 - bad man 0000 0001 0003 0004 - result no yes no no yes In the first test all nights result is "no". That why in the first test result is no. try to understand .. happy coding Edited by author 19.07.2017 23:44 |
Accepted in C | Shaykh Siddique | 1877. Велосипедные коды | 12 янв 2017 14:32 | 2 |
#include<stdio.h> int main(void){ int a, b; scanf("%d %d", &a, &b); if(a%2==0 || b%2!=0) puts("yes"); else if(a%2!=0 || b%2==0) puts("no"); return 0; } else puts("no"); is enough |
RunTime Error in test 15 (python) | 958 | 1877. Велосипедные коды | 20 фев 2016 16:22 | 1 |
raw_input() is ok input() is Runtime error |
Pascal and binary operations | Demenev Dmitriy | 1877. Велосипедные коды | 7 мар 2016 19:55 | 4 |
I used binary operations to solve the problem and I didn't manage make my algorithm faster. My algorithm is too slow (0.015 sec). Could you give me a little advice how I can optimise my algorithm? My facebook: https://www.facebook.com/dmitriy.demenev.7Time is rounded here, so you can only see results like 0.001, 0.015, 0.031, 0.046, 0.062 etc. 0.001 and 0.015 are pretty much equal, and 0.015 can mean pretty much anything between 0.002 and 0.015. Like 0.001, 0.015 is an ideal time, there's nothing to optimize here. Only starting from 0.031 the program might be considered "slightly slow". Thank you, Jane. It was really important for me. I got crazy of this runtime. It was like a bolt out of the blue xD Good luck!. Btw, sorry for my English :D |
Python почему Runtime error | Vigi | 1877. Велосипедные коды | 5 окт 2015 18:05 | 1 |
from random import randint v1 = '' v2 = '' cod1 = ''.join(map(str, [randint(0, 9) for _ in range(1, 5)])) cod2 = ''.join(map(str, [randint(0, 9) for _ in range(1, 5)])) while v1 != cod1 and v2 !=cod2: n = input().split() v1 = n[0] v2 = n[1] if v1 != cod1 and v2 != cod2: print('no') print('yes') |
why test 21 | vladimir | 1877. Велосипедные коды | 20 сен 2015 23:30 | 1 |
var a,b :integer; begin readln(a,b); if a mod 2 = 0 then writeln('yes') else if b = 0 then writeln('no') else if b div 2 mod 2 = 0 then writeln('yes') else writeln('no'); end. |
I need you help, nice folks...Its not working in Java..its correct | Farruh-WIUT | 1877. Велосипедные коды | 19 фев 2015 02:37 | 1 |
import java.util.Scanner; public class JavaThieves877 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int c1 = Integer.parseInt(scanner.next()); int c2 = Integer.parseInt(scanner.next()); if (c1 % 2 == 0 || c2 % 2 != 0) { System.out.print("Yes"); } else if (c1 % 2 != 0 || c2 % 2 == 0) { System.out.print("No"); } } } |
This is running well on Java | Farruh-WIUT | 1877. Велосипедные коды | 21 июн 2017 04:44 | 2 |
import java.util.Scanner; /** * Created by macbookpro on 2/19/15. */ public class JavaThieves877 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int c1 = Integer.parseInt(scanner.nextLine()); int c2 = Integer.parseInt(scanner.nextLine()); if(c1 % 2==0 || c2 % 2!=0 ) { System.out.print("Yes"); } else if(c1 % 2 != 0 || c2% 2== 0) { System.out.print("No"); } } } Nevermind I didn't read that this is running well:) Edited by author 21.06.2017 04:49 |
What is going wrong? (Python 2.7) | Erick Wilts | 1877. Велосипедные коды | 2 июл 2014 20:56 | 2 |
lock1 = input() lock2 = input() if lock1 % 2 == 0 or lock2 % 1 == 1: print "yes" else: print "no" I got WA in testcase 3. Why could that be? Edited by author 21.06.2014 17:45 Same error for me. Don't know the problem man. :( |
Accepted C# | Developer | 1877. Велосипедные коды | 14 май 2014 17:51 | 1 |
using System; using System.Linq; using System.Text; namespace Bicycle_Codes { class Program { static void Main(string[] args) { int c1 = int.Parse(Console.ReadLine()); int c2 = int.Parse(Console.ReadLine()); if (c1 % 2 == 0 || c2 % 2 != 0) Console.WriteLine("yes"); else if (c1 % 2 != 0 || c2 % 2 == 0) Console.WriteLine("no"); //Console.ReadKey(); } } } |
Something is wrong (Ruby) | warezoogle3 | 1877. Велосипедные коды | 14 май 2014 00:50 | 2 |
#!/usr/local/bin/ruby -w f, s = gets.split(" ").map(&:to_i) if f%2==0 || s%2!=0 puts "yes" else puts "no" end What is wrong? I'm unfortunately not know Ruby, but in my opinion f, s = gets.split("\n").map(&:to_i) because second code written at new line. |
What is wrong? | pimiento | 1877. Велосипедные коды | 24 сен 2013 01:51 | 1 |
current_key = int(input().strip()) backup_key = int(input().strip()) for thief_key in range(0, 9999): if current_key == thief_key: print("yes") break if thief_key > current_key or thief_key > backup_key: print("no") break temp_key = backup_key backup_key = current_key current_key = temp_key It passes tests with "0001/0000" -> no and "0002/0001" -> yes. And I traced it, it works right. But they said, that I have wrong answers. Why? P.S. Mistake of course was in the line: if thief_key > current_key or thief_key > backup_key: I should use and instead or. Edited by author 24.09.2013 01:56 |
Why this code on java does'n work/Почему код на java не работает(не проходит проверку) | Big_Brother | 1877. Велосипедные коды | 14 мар 2014 13:33 | 3 |
import java.util.Scanner; public class BicycleCode{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int firstCode = sc.nextInt(); int secondeCode = sc.nextInt();
if(firstCode%2==0 && secondeCode%2!=0){ System.out.println("yes"); }else if(firstCode%2!=0 && secondeCode%2==0){ System.out.println("no"); } } } the correct code: import java.util.Scanner; public class BicycleCode{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int firstCode = sc.nextInt(); int secondeCode = sc.nextInt(); if(firstCode%2==0 || secondeCode%2!=0){ System.out.println("yes"); }else if(firstCode%2!=0 || secondeCode%2==0){ System.out.println("no"); } } 1 Edited by author 14.03.2014 13:34 |
What is this Test #14? | Inacio Medeiros | 1877. Велосипедные коды | 25 май 2013 03:37 | 1 |
What are the values of input in it? |
Why my code does not work? Any sample input to think? | Hissain | 1877. Велосипедные коды | 5 май 2013 00:53 | 3 |
#include<stdio.h> int main(){ int m,n; while(scanf("%d %d",&m,&n) == 2){ if(m == 0 || n == 1){ printf("yes\n"); }else{ printf("no\n"); } } return 0; } Why do you use "while" for reading? |