| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Sol with WA 46, 47, 48 | 🎧 Vadim Barinov \Frez_Fstilus/'``' :) | 1509. Распознавание домино | 14 янв 2018 02:08 | 2 |
WA 46: 2 0 0 0 0.5 Ans: 0 2 WA 47: 2 0 0 0 99 Ans: 1 1 WA 48: 2 0 0 0 1 Ans: 0 2 1 1 > WA 46: > 2 > 0 0 > 0 0.5 > Ans: > 0 2 Your answer is incorrect. There is no dominoes which fit with your input. Maximum related L (for 0-2 domino) is 1/sqrt(2) that is outside of permissible range of [1, 100]. But thank you nonetheless!!! Your hint allowed me to get my AC 8-] |
| WA 12 | Kekwastaken | 1943. Космический пьяница | 14 янв 2018 01:24 | 2 |
WA 12 Kekwastaken 25 дек 2017 11:54 Re: WA 12 ARK (***AESC_USU***) 14 янв 2018 01:24 Increasing (maybe except n) sequence. I.e. something like 1 2 5 3 4, 1 2 3 4 5 6, 7 1 2 3 4 5 6. And answer is "YES". Actually, there are only 7 inputs with answer "NO". Edited by author 14.01.2018 01:28 |
| This is soo000ooo funny problem! | B@R5uk | 1704. Демодуляция | 13 янв 2018 21:30 | 1 |
You need to compute two scalar products, each for 0 bit and 1 bit. Then just compare it. That'a ALL!!! If you are afraid of amplitude being negative then abs() each product and compare them after. There is no need to fuss about anything: carriers and constant level orthogonal to each other and noise guaranteed to be small by problem statement. Well, if noise was too big betrayer would never be able to transmit his data. Even if every bit was transmitted with differen amplitude and different constant level this approach still would work. I just do not undestand why this problem is rated soooooo high?! |
| Chess problem...TLE on test #10!! how to make it faster????? | michel mizrahi | 1298. Конь | 13 янв 2018 01:57 | 9 |
I really stuck with this, I don't know how to make my algorithm faster here is my code: #include <stdio.h> char board[10][10]; char letter[66],num[66]; int n,s=0,ncuad; int pos_f[8]={-1,-2,-2,-1, 1, 2, 2, 1}; int pos_c[8]={-2, 1,-1, 2, 2, 1,-1,-2}; init_board(){ int i,j; for(i=1;i<=n;i++) for(j=1;j<=n;j++) board[i][j]='0'; } search(int i,int f,int c){ int j=0; if(s==1) return 0; if(board[f][c]=='0'){ board[f][c]='1'; switch(f){ case 1: letter[i]='a';break; case 2: letter[i]='b';break; case 3: letter[i]='c';break; case 4: letter[i]='d';break; case 5: letter[i]='e';break; case 6: letter[i]='f';break; case 7: letter[i]='g';break; case 8: letter[i]='h';break; } num[i]=c; if(i==ncuad) s=1; while(j<8 && s==0){ if((f+pos_f[j])>0 && (f+pos_f[j])<=n) if((c+pos_c[j])>0 && (c+pos_c[j])<=n) search(i+1,f+pos_f[j],c+pos_c[j]); j++; } board[f][c]='0'; } } int main(){ int i,j; scanf("%d",&n); ncuad=n*n; init_board(); for(i=1;i<=n;i++) for(j=1;j<=n;j++) search(1,i,j); if(s){ for(i=1;i<=ncuad;i++) printf("%c%d ",letter[i],num[i]); return 0; } else printf("IMPOSSIBLE\n"); return 0; } if someone can help me I would appreciate a lot!! Precalc (-) Dmitry 'Diman_YES' Kovalioff. Retired 12 май 2005 12:22 else begin writeln('a1'); writeln('b3'); writeln('a5'); writeln('b7'); writeln('d8'); writeln('c6'); writeln('b4'); writeln('a2'); writeln('c3'); writeln('b1'); writeln('a3'); writeln('b5'); writeln('a7'); writeln('c8'); writeln('b6'); writeln('a4'); writeln('c5'); writeln('a6'); writeln('b8'); writeln('d7'); writeln('f8'); writeln('e6'); writeln('d4'); writeln('c2'); writeln('e3'); writeln('d1'); writeln('b2'); writeln('c4'); writeln('d6'); writeln('e8'); writeln('g7'); writeln('f5'); writeln('e7'); writeln('g8'); writeln('f6'); writeln('h7'); writeln('g5'); writeln('e4'); writeln('d2'); writeln('f1'); writeln('h2'); writeln('f3'); writeln('e1'); writeln('g2'); writeln('h4'); writeln('g6'); writeln('h8'); writeln('f7'); writeln('h6'); writeln('g4'); writeln('e5'); writeln('d3'); writeln('c1'); writeln('e2'); writeln('g1'); writeln('h3'); writeln('f2'); writeln('h1'); writeln('g3'); writeln('h5'); writeln('f4'); writeln('d5'); writeln('c7'); writeln('a8'); end; thanks! but can I ask you two questions...? first, how many time takes in your computer if you run my code to get the solution for n=8? because my computer is veryy slow and get stuck and number two is it any way to solve it the problem without precalc?? (sorry for my bad english) and thanks again!!! :D:D:D:D:) byee! and good luck! I didn't use precalc. I calculated answer for N using answer for N-1 if it was not 'No Solution' I took first N moves from it. Use the priority array for the chessboard : void init() { int a,b,c; int chessboard[8][8]={0}; int direction[8][2]= { {2,1},{-2,1},{2,-1},{-2,-1}, {1,2},{-1,2},{1,-2},{-1,-2}, }; for(a=0;a<n;a++) { for(b=0;b<n;b++) { int count=0; for(c=0;c<n;c++) { int x1 = a+direction[c][0]; int y1 = b+direction[c][1]; if(x1>=0&&x1<n&&y1>=0&&y1<n) count++; } chessboard[a][b] = count; } } } For example, n = 8 : 2 3 4 4 4 4 3 2 3 4 6 6 6 6 4 3 4 6 8 8 8 8 6 4 4 6 8 8 8 8 6 4 4 6 8 8 8 8 6 4 4 6 8 8 8 8 6 4 3 4 6 6 6 6 4 3 2 3 4 4 4 4 3 2 go to the cell with minimum priority first ! Good luck ! Edited by author 17.02.2009 12:04 Edited by author 17.02.2009 12:04 How can here be >=10 tests if 1<=n<=8? |
| C# Please, Help! Where is wrong? | Serge | 1563. Баяны | 12 янв 2018 05:28 | 1 |
The answer is correct, but it returns an error. Why? Maybe I did not understand the condition of the task correctly, or can the data be specified for which this code will produce the wrong solution? using System; namespace ConsoleApp30 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int x = 0; string[] shoplist = new string[n]; for (int i = 0; i <n; i++) { shoplist[i] = Console.ReadLine(); } for (int i = 0; i < shoplist.Length; i++) { for (int j = i + 1; j<shoplist.Length; j++) { if (shoplist[i] == shoplist[j]) { x++; i++; } else { continue; } } } Console.WriteLine(x); //Console.ReadKey(); } } } |
| Runtime error | Unfeeling | 1545. Иероглифы | 12 янв 2018 02:44 | 2 |
using System; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); string [] ch= new string [100]; string c; for (int i=0;i<n;i++) ch[i]=Console.ReadLine(); c=Console.ReadLine(); for (int i=0;i<n;i++) { if (c==ch[i].Substring(0,1)) Console.WriteLine(ch[i]); } Console.ReadKey(); } } } what's the problem??? help me please Use comment for this line (or delete this line) //Console.ReadKey(); |
| Is it possible to mathematically prove that it is necessary to use the Fibonacci numbers | IlushaMax | 1225. Флаги | 11 янв 2018 09:50 | 2 |
I mean not just to see on examples and find a pattern |
| An explanation why the doubled Fibanucci sequence is suitable here | Ivan Avdonin (Vologda ML, MSU) | 1225. Флаги | 11 янв 2018 09:34 | 1 |
Let's define C(k,n) = n!/(k!(n-k)!). Binomial coefficients are widely used in combinatorics. The number of ways you can place something on something is an binomial coefficient. But we can't place the blue stripe on the end of the flag and side by side. It is well-known, that C(0,n) + C(1,n) + ... + C([n/2],[n/2]) = F[n+1] where F[n+1] is (n+1)-th Fibonacci number and [n/2] is integer division [1]. I hope this my small review does not spoil you the solving of the problem. Thank you. [1] https://en.wikipedia.org/wiki/Fibonacci_number (Use in Mathematics) accepted/sended = 13616/35461 Edited by author 11.01.2018 10:21 Edited by author 17.06.2019 01:04 Edited by author 17.06.2019 01:04 |
| Where is my fault?(C answer) | LK Duan | 1001. Обратный корень | 10 янв 2018 19:19 | 2 |
#include<stdio.h> #include<math.h> #define size 256*1024/sizeof(long long) int main() { int s=0,l; long long int a[size+1]; do{l=scanf("%lld",a[s++]);}while(l!=EOF); for(s=s-2;s>=0;s--) printf("%.4Lf\n", sqrt((double)a[s])); } The input may contain upto 256 * 1024 / 2 numbers ("1 1 1 1 1 ..."). |
| If you have WA2 | PrankMaN | 1400. Сотовые символы | 10 янв 2018 19:15 | 2 |
|
| thank you. cool task - | kasarino | 2045. Богатство слов | 10 янв 2018 18:47 | 1 |
|
| wh Test 3 | Khamidjon | 1654. Шифровка | 10 янв 2018 15:20 | 1 |
// Harry Poter #include <stdio.h> #include <iostream> #include <stdlib.h> #include <string.h> using namespace std; int main() { char line[200001], w2[200001]; cin.getline(line, sizeof(line)); int t = 0, i; for(i = 0; i < strlen(line); i++){ if (line[i] == line[i + 1]) { i++; A: if (line[i + 1] != line[i + 2]) { if (t != 0 && w2[t - 1] == line[i + 1]) {t--; i += 1; goto A;} } } else {w2[t++] = line[i];} } w2[t] = '\0'; printf("%s", w2); } |
| Wrong tests? n = 1 | marina311 | 1131. Копирование | 10 янв 2018 07:12 | 1 |
If n = 1 answer is 0, but accepted solution with answer 1. Why??? |
| Возможные недочёты в условии задачи | Alexandr | 1001. Обратный корень | 10 янв 2018 03:49 | 2 |
"отделённых друг от друга ПРОИЗВОЛЬНЫМ КОЛ-ВОМ пробелов и переводов строк" - это меня "убивает"... По сути ведь получается, что непонятно, когда заканчивается ввод исходных данных. Не так ли? Или я могу чего-то не знать? <python> есть такое понятие как константа EOF, она, собственно, и должна служить концом ввода Edited by author 10.01.2018 03:49 Edited by author 10.01.2018 03:49 |
| Who can tell me what is the test 3??? | Tural Gulmammadov | 1446. Волшебная шляпа | 9 янв 2018 20:19 | 2 |
|
| Христа ради спасите // Help please | Rustam_True_Proger | 1001. Обратный корень | 8 янв 2018 21:15 | 3 |
#include "stdafx.h" #include<stdio.h> #include<math.h> int _tmain(int argc, _TCHAR* argv[]) { float a; scanf_s("%f", &a); printf_s("%6.4f", sqrt(a)); scanf_s("%f", &a); return 0; } |
| I have some mistakes, help me find it!!! | Sergey Volodin | 1263. Выборы | 7 янв 2018 17:36 | 1 |
a=input().split() t=0 for i in range(len(a)): c=a[t] v=int(c) a[t]=v t=t+1 e=[0] s=[0] z=[0] q=[0] y=1 for i in range(a[1]): d=int(input()) s.append(d) s.remove(s[0]) for i in range(0,a[0]): w=s.count(y) z.append(w) w=0 y=y+1 z.remove(z[0]) t=0 for i in range(len(z)): c=z[t] v=int(c) z[t]=v t=t+1 t=0 c=0 for i in range(len(z)): c=z[t]/a[1] c=c*100 q.append(c) t=t+1 q.remove(q[0]) t=0 c=0 for i in range (len(q)): c=round(q[t],2) e.append(c) t=t+1 e.remove(e[0]) t=0 for i in range (len(e)): print(e[t],"%") t=t+1 |
| No subject | Sergey Volodin | 1327. Предохранители | 7 янв 2018 14:21 | 1 |
Edited by author 07.01.2018 14:22 Edited by author 07.01.2018 14:23 |
| easy bfs | Aditya Singh | 1080. Раскраска карты | 7 янв 2018 09:27 | 1 |
|
| Which is the father node? | GongLiangqi | 1471. Расстояние в дереве | 6 янв 2018 11:31 | 4 |
u and v,which is the father node? There's no father node. You can do topsort and choose it yourself. Um... You can't topsort a given tree, because it's an undirected graph. |