Monday, May 1, 2017

URI Solution 1267 Pascal Library - Solution in C++ | Ad Hoc

URI Solution 1267 Pascal Library - Solution in C++ | Ad Hoc


URI Online Judge Solution  Pascal Library | Ad Hoc
URI Main Problem Link - https://www.urionlinejudge.com.br/judge/en/problems/view/1267

Problem Name: URI Problem 1267 Pascal Library
Problem Number : URI Problem 1267  Solution
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus

URI Solution 1267 Code in CPP: 


#include <cstdio>
using namespace std;

int main()
{
 int n, d, x;
 bool check, one;

 while(scanf("%i %i", &n, &d) && (n || d))
 {
  int din[n + 1][d + 1];
  check = false; one = false;
  for (int i = 0; i < d; ++i)
  {
   for (int j = 0; j < n; ++j)
   {
    scanf("%i", &x);
    din[j][i] = x;
   }
  }

  for (int i = 0; i < n; ++i)
  {
   check = true;
   for (int j = 0; j < d; ++j)
   {
    if(din[i][j] == 0)
     check = false;
   }
   if(check == true)
    one = true; 
  }

  if(one == true){
   printf("yes\n");
  }else{
   printf("no\n");
  }

 }

 return 0;
}

No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.