Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Hint | Kirill~ | 1712. Шифровальная решётка | 18 мар 2022 22:58 | 1 |
Hint Kirill~ 18 мар 2022 22:58 pair <int,int> rotate(int x,int y) { return make_pair(y,3-x); } |
test#1. Why? | Igor | 1712. Шифровальная решётка | 26 фев 2019 13:29 | 1 |
#include <iostream> using namespace std; char paper[4][4], pass[4][4],rPass[16],TempPaper[4][4]; int v, i, j; void check(char paper[4][4], char pass[4][4]) { for (int j = 0; j < 4; j++)// X/. { for (int i = 0; i < 4; i++) { if (paper[j][i] == 'X') { rPass[v] = pass[j][i]; v++; } } } } int main() { for (int j = 0; j < 4; j++) //paper cin { for (int i = 0; i < 4; i++) { cin >> paper[j][i]; } } for (int j = 0; j < 4; j++)//зашифрованый пароль { for (int i = 0; i < 4; i++) { cin >> pass[j][i]; } } for (int j = 0; j < 4; j++)//temp { for (int i = 0; i < 4; i++) { TempPaper[j][i] = paper[j][i]; } } check(paper, pass); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { int t=0, y; if (j == 0) { int u = 3; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[0][y]; t++; } } if (j == 1) { int u = 2; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[1][y]; t++; } } if (j == 2) { int u = 1; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[2][y]; t++; } } if (j == 3) { int u = 0; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[3][y]; t++; } } } check(paper, pass); for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { TempPaper[j][i] = paper[j][i]; } } } return 0; } |
Different Execution Time | mike1808 | 1712. Шифровальная решётка | 8 янв 2017 01:53 | 3 |
Can anybody explain me why one program can have different execution time with the same code? My friend with my code got 0.015 but I got 0.031. Oops =) I send it one more time and get 0.015. Maybe it because of server... Edited by author 22.11.2010 21:59 I had 0.031 sec, but now I finally got 0.015 sec! I've just replaced four loops with one loop. Probably depends on server current loading. |
To admins | Andrew Sboev | 1712. Шифровальная решётка | 24 окт 2013 20:19 | 3 |
My AC solution outputs extra empty line before outputing answer for the task. I think, it is not right, or I'm mistaken? That is OK. In this problem you may output any space characters before and after password. Interesting, that my solution got AC after I added \n to the end. Without \n (just 16 symbols) I have WA#1. Problems with checker? |
What is 2-test | Doston | 1712. Шифровальная решётка | 15 окт 2013 01:11 | 2 |
wy wrong#2 help me please!!! What is second test |
HELP please | SamGTU5_Ukhova_Yulia_Alexandrovna | 1712. Шифровальная решётка | 20 май 2013 21:56 | 1 |
HELP please SamGTU5_Ukhova_Yulia_Alexandrovna 20 май 2013 21:56 here my program, prompt in what a mistake. when I send to check the error of compilation writes... #include <iostream> using namespace std; void main() { const int n = 4; char Resh[n][n], OldResh[n][n], Shifr[n][n]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin » Resh[i][j]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin » Shifr[i][j]; for (int k = 0; k < 4; k++) { for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) if (Resh[i][j] == 'X') cout « Shifr[i][j]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) OldResh[i][j] = Resh[i][j]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) Resh[i][j] = OldResh[n - 1 - j][i]; } system("pause"); } Edited by author 24.05.2013 01:05 |
Easy to solve HINT | AzizIO | 1712. Шифровальная решётка | 17 окт 2012 02:36 | 1 |
Code in C#!!! first of ALL just print and reverse print .... 3 times static string [,] reverse(string[,] arr) { string[,] tmp = new string [4,4];
for (int i = 0; i < 4; i++) { for (int j = 0; j < 4 ; j++) { tmp[i,j] = arr[4-j-1,i]; } } return tmp; } in this case i wrote code for 4x4 array!!! you can change your code to tmp[i,j] = arr[3-j,i] if u want reverse nxn array change all 4 to n GooD Luck! sorry for my english!! Edited by author 17.10.2012 02:39 |
test #1 | Yagudin Ruslan | 1712. Шифровальная решётка | 8 дек 2011 00:35 | 1 |
test #1 Yagudin Ruslan 8 дек 2011 00:35 program Project3; {$APPTYPE CONSOLE} uses SysUtils; type re=array[1..4,1..4] of char; var c,r:re ; i,j:integer; s:string; procedure vyvod(m:re) ; begin for I := 1 to 4 do for j := 1 to 4 do if m[i,j]='X' then write(r[i,j]); end; procedure perevorot(var w:re) ; var w2:re; begin vyvod(w); for I := 1 to 4 do for j := 1 to 4 do w2[i,j]:='.'; for I := 1 to 4 do if w[1,i]='X' then w2[i,4]:='X'; for I := 1 to 4 do if w[4,i]='X' then w2[i,1]:='X'; for I := 2 to 3 do if w[i,1]='X' then w2[1,5-i]:='X'; for I := 2 to 3 do if w[i,4]='X' then w2[4,i]:='X'; //rgrgr X if w[2,2]='X' then w2[2,3]:='X'; if w[2,3]='X' then w2[3,3]:='X'; if w[3,3]='X' then w2[3,2]:='X'; if w[3,2]='X' then w2[2,2]:='X'; for I := 1 to 4 do for j := 1 to 4 do w[i,j]:=w2[i,j]; end; begin for I := 1 to 4 do begin for j := 1 to 3 do begin read(c[i,j]); end; readln(c[i,j]); end; for I := 1 to 4 do begin for j := 1 to 3 do begin read(r[i,j]); end; readln(r[i,j]); end; perevorot(c); perevorot(c); perevorot(c); perevorot(c); readln;readln; end. |
Why is wrong on test 5#. Please help me... | NUUZ_1 | 1712. Шифровальная решётка | 4 дек 2011 18:02 | 1 |
Please give me test 5# if you have,or send me your code (oa1990_10_17@mail.ru). #include"iostream" using namespace std; void Tar(int K[][2]); int main() { int K[4][2],k=0; char s[4][5],c,ss[17]; for(int i=1;i<=4;i++) for(int j=1;j<=4;j++) { cin>>c; if(c=='X') { K[k][0]=i; K[k][1]=j; k++; } } for(int i=0;i<4;i++) { cin>>s[i]; } k=0; for(int i=1;i<5;i++) { ss[k]=s[K[0][0]-1][K[0][1]-1]; k++; ss[k]=s[K[1][0]-1][K[1][1]-1]; k++; ss[k]=s[K[2][0]-1][K[2][1]-1]; k++; ss[k]=s[K[3][0]-1][K[3][1]-1]; k++; for(int j=0;j<4;j++) { int t=K[j][0]; K[j][0]=K[j][1]; K[j][1]=5-t; } Tar(K); } ss[16]='\0'; cout<<ss; return 0; } void Tar(int K[][2]) { for(int i=0;i<4;i++) { for(int j=i+1;j<4;j++) { if(K[j][0]<K[i][0]) { int k=K[i][0],t=K[i][1]; K[i][0]=K[j][0]; K[i][1]=K[j][1]; K[j][0]=k;K[j][1]=t; } } } for(int i=1;i<4;i++) { if(K[i][0]==K[i-1][0]&&K[i][1]<K[i-1][1]) { int t=K[i][1]; K[i][1]=K[i-1][1]; K[i-1][1]=t; } } } |
Here is Hint to solve | Anupam Ghosh, Wipro Technologies | 1712. Шифровальная решётка | 6 ноя 2011 04:52 | 1 |
1.find out the equtaion, to get next location of new character after rotation each time. 2.sort the locations on basis of height. 3. print the characters on those locations. All the best. Regards Anupam Edited by author 06.11.2011 04:53 |
WA test 1 | Jumabek_Alihonov | 1712. Шифровальная решётка | 23 сен 2011 18:08 | 1 |
my solution #include<string> #include<iostream> using namespace std; int main() {char a[4][4],c[4][4]; int b[4][4],i,j,t; for(i=1;i<=4;i++) for(j=1;j<=4;j++) cin>>c[i][j]; for(i=1;i<=4;i++) for(j=1;j<=4;j++) cin>>a[i][j]; cout<<endl; //1 qator for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='X') cout<<a[i][j]; //2-qator for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='X') c[j][5-i]='1';
for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='1') cout<<a[i][j]; //3-qator for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='1') c[j][5-i]='2'; for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='2') cout<<a[i][j]; for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='2') c[j][5-i]='3'; for(i=1;i<=4;i++) for(j=1;j<=4;j++) if(c[i][j]=='3') cout<<a[i][j]; } |
why is wrong answer | data lapiashvili | 1712. Шифровальная решётка | 8 авг 2011 22:33 | 2 |
in 1712 i have made this: [code deleted] why is a wrong answer???? Edited by moderator 19.11.2019 22:45 c[i2,j1]='x' May be big x - X |
THRILLER! | Micheal Jackson | 1712. Шифровальная решётка | 4 ноя 2010 14:20 | 1 |
I AM SO SCARED OF THIS PROBLEM, AAAAAH |
please send me a solution | zie7lak | 1712. Шифровальная решётка | 15 июн 2010 00:16 | 1 |
my e-mail is griszka90@wp.pl |
test_7 | Ashot(YSU) | 1712. Шифровальная решётка | 24 мар 2010 18:37 | 2 |
test_7 Ashot(YSU) 30 янв 2010 21:23 please make your array bigger! |
test 5????? | zsyzhbc_china | 1712. Шифровальная решётка | 7 мар 2010 10:41 | 1 |
|
why is that? anyone please help | null | 1712. Шифровальная решётка | 21 фев 2010 16:11 | 1 |
ofcourse i've tried it on my computer it runs that program just fine i've tried submitting my solution 3 times. why is it giving me CE and WA can anyone explain it? |
somebody send me your solution | Leks | 1712. Шифровальная решётка | 25 окт 2009 21:26 | 1 |
|