- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
{1}
if ((a='AC')or(a='CA')or(a='BD')or(a='DB'))and((b='AC')or(b='CA')or(b='BD')or(b='DB'))then write('YES') else
if ((a='AC')or(a='CA')or(a='BC')or(a='CB'))and((b='AC')or(b='CA')or(b='BC')or(b='CB'))then write('YES') else
if ((a='BC')or(a='CB')or(a='BD')or(a='DB'))and((b='BC')or(b='CB')or(b='BD')or(b='DB'))then write('YES') else
if ((a='AB')or(a='BA')or(a='BD')or(a='DB'))and((b='AB')or(b='BA')or(b='BD')or(b='DB'))then write('YES') else
if ((a='AC')or(a='CA')or(a='AB')or(a='BA'))and((b='AC')or(b='CA')or(b='AB')or(b='BA'))then write('YES') else
if ((a='AC')or(a='CA')or(a='AD')or(a='DA'))and((b='AC')or(b='CA')or(b='AD')or(b='DA'))then write('YES') else
if ((a='AD')or(a='DA')or(a='BD')or(a='DB'))and((b='AD')or(b='DA')or(b='BD')or(b='DB'))then write('YES') else
if ((a='AC')or(a='CA')or(a='CD')or(a='DC'))and((b='AC')or(b='CA')or(b='CD')or(b='DC'))then write('YES') else
if ((a='DC')or(a='CD')or(a='BD')or(a='DB'))and((b='DC')or(b='CD')or(b='BD')or(b='DB'))then write('YES') else
if ((a='BC')or(a='CB')or(a='CD')or(a='DC'))and((b='BC')or(b='CB')or(b='CD')or(b='DC'))then write('YES') else
if ((a='AD')or(a='DA')or(a='CD')or(a='DC'))and((b='AD')or(b='DA')or(b='CD')or(b='DC'))then write('YES') else
if ((a='AB')or(a='BA')or(a='AD')or(a='DA'))and((b='AB')or(b='BA')or(b='DA')or(b='AD'))then write('YES') else
if ((a='AB')or(a='BA')or(a='BC')or(a='CB'))and((b='AB')or(b='BA')or(b='BC')or(b='CB'))then write('YES') else
{2}
if ((a='A1C1')or(a='C1A1')or(a='B1D1')or(a='D1B1'))and((b='A1C1')or(b='C1A1')or(b='B1D1')or(b='D1B1'))then write('YES') else
if ((a='A1C1')or(a='C1A1')or(a='B1C1')or(a='C1B1'))and((b='A1C1')or(b='C1A1')or(b='B1C1')or(b='C1B1'))then write('YES') else
if ((a='B1C1')or(a='C1B1')or(a='B1D1')or(a='D1B1'))and((b='B1C1')or(b='C1B1')or(b='B1D1')or(b='D1B1'))then write('YES') else
if ((a='A1B1')or(a='B1A1')or(a='B1D1')or(a='D1B1'))and((b='A1B1')or(b='B1A1')or(b='B1D1')or(b='D1B1'))then write('YES') else
if ((a='A1C1')or(a='C1A1')or(a='A1B1')or(a='B1A1'))and((b='A1C1')or(b='C1A1')or(b='A1B1')or(b='B1A1'))then write('YES') else
if ((a='A1C1')or(a='C1A1')or(a='A1D1')or(a='D1A1'))and((b='A1C1')or(b='C1A1')or(b='A1D1')or(b='D1A1'))then write('YES') else
if ((a='A1D1')or(a='D1A1')or(a='B1D1')or(a='D1B1'))and((b='A1D1')or(b='D1A1')or(b='B1D1')or(b='D1B1'))then write('YES') else
if ((a='A1C1')or(a='C1A1')or(a='C1D1')or(a='D1C1'))and((b='A1C1')or(b='C1A1')or(b='C1D1')or(b='D1C1'))then write('YES') else
if ((a='D1C1')or(a='C1D1')or(a='B1D1')or(a='D1B1'))and((b='D1C1')or(b='C1D1')or(b='B1D1')or(b='D1B1'))then write('YES') else
if ((a='B1C1')or(a='C1B1')or(a='C1D1')or(a='D1C1'))and((b='B1C1')or(b='C1B1')or(b='C1D1')or(b='D1C1'))then write('YES') else
if ((a='A1D1')or(a='D1A1')or(a='C1D1')or(a='D1C1'))and((b='A1D1')or(b='D1A1')or(b='C1D1')or(b='D1C1'))then write('YES') else
if ((a='A1B1')or(a='B1A1')or(a='A1D1')or(a='D1A1'))and((b='A1B1')or(b='B1A1')or(b='D1A1')or(b='A1D1'))then write('YES') else
if ((a='A1B1')or(a='B1A1')or(a='B1C1')or(a='C1B1'))and((b='A1B1')or(b='B1A1')or(b='B1C1')or(b='C1B1'))then write('YES') else
//оставшуюся часть я опустил из-за ее невместимости в 4000 символов.
writeln('NO');
end.
Этот говнокод (полностью, а не этот говнокусок) по идее должен выискивать пересечения отрезков куба. Мы с другом поспорили, что я смоу написать прогу только с ifами, и олимпиадный сайт accepted ее.Он принял.