SHARE
TWEET

Untitled

a guest Nov 20th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int n,m;
  7. int v[404];
  8. bool ok[404];
  9. int matrice[21][21];
  10. bool caract[21][21];
  11.  
  12. int dx[]={1,0,-1,0};
  13. int dy[]={0,-1,0,1};
  14.  
  15. void citire(){
  16.     ifstream fin("spg.in");
  17.     ofstream fout("spg.out");
  18.     fin>>n>>m;
  19.     cin>>v[0]>>v[1];
  20.     int q=v[1]/v[0];
  21.     if(v[0]*q!=v[1]){
  22.         cout<<v[0]<<" "<<v[1];
  23.         n=0;
  24.         m=0;
  25.     }
  26.     for(int i=2;i<n*m;i++)
  27.     {
  28.         cin>>v[i];
  29.         if(v[i]!=v[i-1]*q){
  30.             cout<<v[i-1]<<" "<<v[i];
  31.             i=500;
  32.         }
  33.     }
  34.  
  35. }
  36. void bordare(){
  37.     for(int i=0;i<=m+1;i++){
  38.         caract[0][i]=caract[n+1][i]=1;
  39.     }
  40.     for(int i=0;i<=n+1;i++){
  41.         caract[i][0]=caract[i][m+1]=1;
  42.     }
  43. }
  44. void afisareBasic(){
  45.  
  46. for(int i=0;i<=n+1;i++){
  47.     for(int j=0;j<=m+1;j++){
  48.             cout<<caract[i][j];
  49.         }
  50.         cout<<endl;
  51.     }
  52. }
  53. void genMat(){
  54.  
  55.  
  56.  
  57.  
  58.  
  59. }
  60.  
  61. /*void genMat(int x,int y, int dr,int i){
  62.     if(i==n*m) return ;
  63.     int xTest=x+dx[dr];
  64.     int yTest=y+dy[dr];
  65.     if(caract[xTest][yTest]==0)
  66.     {
  67.         caract[xTest][yTest]=1;
  68.         matrice[xTest][yTest]=v[i++];
  69.         genMat(xTest,yTest,dr,i);
  70.     }
  71.     else
  72.     {
  73.         dr++;
  74.         if(dr>3)
  75.             dr=1;
  76.         genMat()
  77.     }
  78. }
  79. */
  80. int main()
  81. {
  82.     citire();
  83.     return 0;
  84. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top