Войти
|
Зарегистрироваться
Главная
Топ
Каталог
Соревнования
Тренировки
Архив
Группы
Рейтинг
Edu
API
Календарь
Помощь
Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация
здесь
.
×
pratikmoona
Блог
Команды
Попытки
Группы
Соревнования
Блог пользователя pratikmoona
Google Code Jam Round 1A : Problem A
Автор
pratikmoona
,
15 лет назад
,
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
15 лет назад
4
Комментарии (4)
Написать комментарий?
sholeg
15 лет назад
,
показать (+
1
)
#
sholeg
15 лет назад
,
скрыть
#
|
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
15 лет назад
,
показать
#
pratikmoona
15 лет назад
,
скрыть
#
^
|
+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
15 лет назад
,
показать (+
1
)
#
unprost
15 лет назад
,
скрыть
#
|
←
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
15 лет назад
,
показать
#
pratikmoona
15 лет назад
,
скрыть
#
^
|
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.
→
Ответить
По-английски
По-русски
↑
↓
→ Обратите внимание
До соревнования
Codeforces Round 1133 (Div. 1)
13:23:22
Зарегистрироваться »
*есть доп. регистрация
До соревнования
Codeforces Round 1133 (Div. 2)
13:23:22
Зарегистрироваться »
*есть доп. регистрация
→ Лидеры (рейтинг)
№
Пользователь
Рейтинг
1
B
enq
3676
2
K
evin114514
3659
3
j
iangly
3640
4
t
urmax
3450
5
t
ourist
3382
6
s
trapple
3360
7
U
m_nik
3354
8
s
quareOf105
3348
9
m
aroonrk
3312
10
i
dontwannadothis…e
3191
Страны
|
Города
|
Организации
Всё →
→ Лидеры (вклад)
№
Пользователь
Вклад
1
Q
ingyu
155
2
nik_exists
151
3
m
aspy
149
4
AmShZ
145
5
U
m_nik
143
6
Errichto
139
7
BledDest
136
8
adamant
134
9
m
aroonrk
132
10
cry
130
Всё →
→ Найти пользователя
Хэндл:
→ Прямой эфир
eugenechka.boyko.2_0-0
→
Codeforces Round 1132 (Div. 2)
buachudanike
→
Codeforces Round 1132 (Div. 2) — Editorial (Unofficial)
t
urmax
→
Are we ready for AGI?
pashka
→
JetBrains Youth Coding Club 2026
Temirulan
→
ICPC/IOI Alumni Meetup in SF - Dec 4
jonathanirvings
→
Both OpenAI and Deepmind are excited to announce/share
bicsi
→
Optimal Incremental MST in 20 lines of code
applepi216
→
Codeforces Round 1133 (Div. 1, Div. 2)
omsincoconut
→
WorldQuant Round 1 (Codeforces Round 1128, Div. 1 + 2) Editorial
MrPupsik
→
backrooms (real endless)
Teja-Smart
→
Teja-Smart vs Arpa — Codeforces Speed Battle (LIVE!)
xefiso4711
→
I don't want to be a cheater anymore
QuantumXF
→
Compete in Head-to-Head Codeforces Battles with CodexForce
Arpa
→
Arpa vs Teja-Smart — Codeforces Speed Battle (LIVE!)
specia1
→
Благодарность сообществу. Помогу людям с рейтингом < 1200 подняться до 1500 за спасибо.
MikeMirzayanov
→
Изменение правил об использовании стороннего кода в соревнованиях Codeforces
wuhudsm
→
Codeforces Round 1131 (Div. 3)
BledDest
→
Educational Codeforces Round 196 — Editorial
ankitkumar1234__
→
ICPC India Amritapuri Regionals: Rank ~450 (6 solved) rejected, Rank ~3700 (1 solved) selected.
lu3kyc0mb0
→
CF Helper: Улучшенные фильтры архива задач
_blub
→
Where do I start?
ko_osaga
→
The Day the Problem Solving Died
atcoder_official
→
AtCoder Beginner Contest 483 Announcement
wakanda-forever
→
Codeforces Round 1131 (Div. 3) Editorial
wangmarui
→
Hello 2026 Editorial
Детальнее →
Списки пользователей
Название
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