This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int x=0,y=0,z=5000; | |
| int n,m,k,A,B,Xn,Ym,Zk; | |
| cin>>n; | |
| for(int i=0;i<n;i++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| pair<int,int>a[1000],c[1000]; | |
| int p,q,l,r; | |
| bool solve(int shift) | |
| { | |
| int i=1,j=1; | |
| while(i<=p&&j<=q) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| string s1,s2; | |
| cin>>s1>>s2; | |
| int count=0,count1=0,count2=0,count3,count5,count6=0; | |
| for(int i=0;i<s1.size();i++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int n,m,x,y,a[101]={0},b[101][101]={0},count1,c[101]={0},count2=0; | |
| cin>>n>>m; | |
| while(m--) | |
| { | |
| cin>>x>>y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int num; | |
| cin>>num; | |
| int a[num],b[num]; | |
| for(int i=0;i<num;i++) | |
| cin>>a[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int n,m,check[27]={0},res=0; | |
| char c,a[150][150]; | |
| cin>>n>>m>>c; | |
| for(int i=0;i<n;i++) | |
| for(int j=0;j<m;j++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int n,a[1001]={0},x,res=0; | |
| cin>>n; | |
| for(int i=0;i<n;i++) | |
| { | |
| cin>>x; | |
| if(res<++a[x])res=a[x]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| //Dynamic programming | |
| int num, x,y,d[100000]={0}; | |
| vector<int>m; | |
| string s; | |
| cin>>s>>num; | |
| for(int i=s.size()-2;i>=0;i--) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int n;long s; | |
| cin>>n>>s; | |
| long population=s; | |
| vector< vector< long > >location(n,vector<long>(2)); | |
| for(int i=0;i<n;i++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int n,q; | |
| cin>>n; | |
| vector<int>x(n); | |
| for(int i=0;i<n;i++) | |
| cin>>x[i]; | |
| sort(x.begin(),x.end()); |