Войти
|
Зарегистрироваться
Главная
Топ
Каталог
Соревнования
Тренировки
Архив
Группы
Рейтинг
Edu
API
Календарь
Помощь
pratikmoona
Блог
Команды
Попытки
Группы
Соревнования
Блог пользователя pratikmoona
Google Code Jam Round 1A : Problem A
Автор
pratikmoona
,
13 лет назад
,
Problem A
of the recently held CodeJam Round 1A has the following
official analysis
. I however coded an O(1) solution.
http://codepad.org/DZkgW35q
Did anyone else do this directly like this?
algorithm complexity
,
codejam
,
google
+5
pratikmoona
13 лет назад
4
Комментарии (4)
Написать комментарий?
sholeg
13 лет назад
,
#
|
0
Your solution is the same with official. However it isn't O(1), because in your code GCD can't be calculated with O(1) time.
→
Ответить
pratikmoona
13 лет назад
,
#
^
|
+8
It is O(1) as complexity of GCD(a, b) is log(max(a, b)). Here one of them is 100 and that will be >= the percentage, which is a constant.
→
Ответить
unprost
13 лет назад
,
#
|
←
Rev.
2
→
0
It can be coded simplier. Frined solved this like:
cin >> n >> pd >> pg;
bool possible;
if ( pd != 0 && pg == 0 || pd != 100 && pg == 100) possbile = false;
else possible = (100/__gcd(pd, 100) <= n);
But it's described in analysis
→
Ответить
pratikmoona
13 лет назад
,
#
^
|
0
I wouldn't call this simpler! It is definitely shorter though...
I couldn't figure out which part of the analysis actually talked about this solution.
→
Ответить
По-английски
По-русски
↑
↓
→ Обратите внимание
До соревнования
CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!)
5 дней
Зарегистрироваться »
*есть доп. регистрация
→ Лидеры (рейтинг)
№
Пользователь
Рейтинг
1
t
ourist
3690
2
j
iangly
3647
3
B
enq
3581
4
o
rzdevinwang
3570
5
G
eothermal
3569
5
c
nnfls_csy
3569
7
R
adewoosh
3509
8
e
cnerwala
3486
9
j
qdai0815
3474
10
g
yh20
3447
Страны
|
Города
|
Организации
Всё →
→ Лидеры (вклад)
№
Пользователь
Вклад
1
maomao90
173
2
awoo
164
3
adamant
163
4
TheScrasse
159
5
nor
157
6
m
aroonrk
156
7
-is-this-fft-
152
8
P
etr
146
8
orz
146
10
pajenegod
145
Всё →
→ Найти пользователя
Хэндл:
→ Прямой эфир
Vladosiya
→
Codeforces Round #946 (Div. 3)
Mhn_Neek
→
700-th problem
Nummer_64
→
IOI 2024 Teams
op_vimdhayak
→
Whom to follow to learn Problem solving ??
Inno_KPK
→
Летняя школа по олимпиадной подготовки 2024
ItsAboudTime
→
ACM Marathon 2024 Tutorial
ragemonster47
→
How to Search Problem by Name?
prabowo
→
Online mirror of The 2023 ICPC Asia Jakarta Regional Contest
NeroZein
→
[Discussion Thread] APIO 2024
yuaksoinocenow
→
Solving past OI problems
saiteja_0712
→
1974C. Beautiful triple pairs -> help with this
djm03178
→
Can we upgrade contest divisions?
prvocislo
→
Editorial for Codeforces Round #945 (Div. 2)
galen_colin
→
shenanigans
Dominater069
→
Invitation to CodeChef Starters 135 (Rated till 5-Stars) — 22nd May
sahkumar.bishwash
→
CF Round 946(Div. 3). The same code got passed in Python 3 but it is giving tle in PyPy 3-64.
dmraykhan
→
EJOI 2024 Teams
BERNARD
→
IIOT 2024 (UPD: +Online mirror)
copyPasteCoder
→
How to I start practicing on SPOJ or UVa
atcoder_official
→
Panasonic Programming Contest 2024(AtCoder Beginner Contest 354) Announcement
jamjury
→
Huawei half-precision floating-point range
sharmahappy654
→
217A Ice Skating
no_lie
→
Introducing cses-enhancer: An extension for CSES problemset to add notes and mark tasks as favorite
Desmos
→
Puzzle of the Day: How Many Whole Squares Fit in a 130 by 130 Rectangle?
Agnimandur
→
CSES Problem Set: Now on Codeforces!
Детальнее →
Списки пользователей
Название
cin >> n >> pd >> pg;
bool possible;
if ( pd != 0 && pg == 0 || pd != 100 && pg == 100) possbile = false;
else possible = (100/__gcd(pd, 100) <= n);
But it's described in analysis