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 num,start,end,max=0,gap=0; | |
| cin>>num; | |
| pair<int,int>x[5000]; | |
| for(int i=0;i<num;i++) | |
| cin>>x[i].first>>x[i].second; | |
| sort(x,x+num); |
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; | |
| vector<int> minimum(int n) | |
| { | |
| vector<int>num(n+1); | |
| num[0]=0; | |
| for(int i=1;i<num.size();i++) | |
| { | |
| num[i]=num[i-1]+1; | |
| if(i%2==0) |
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 minimum(int x,int y,int z) | |
| { | |
| return min(min(x,y),z); | |
| } | |
| int editdistance(string str1,string str2,int n,int m) | |
| { | |
| int dp[m+1][n+1]; | |
| for(int i=0;i<=m;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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| #define min(a, b) (((a)<(b))?(a):(b)) | |
| #define max(a,b) (((a)>(b))?(a):(b)) | |
| int answer(int height, int planks_to_complete, vector <int>& planks) { | |
| int begin, end, vertical_planks, planks_used; | |
| begin = 0; | |
| end = planks.size() - 1; | |
| vertical_planks = 0; | |
| planks_used = 0; |
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 <stdio.h> | |
| int main() { | |
| int a,b,c,d,e,f,max=0; | |
| while(scanf("%d",&a)!=EOF) | |
| { | |
| for(b=1,max=0; b<=a; b++) | |
| { | |
| scanf("%d", &c); | |
| if(c>max) |
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 <stdio.h> | |
| int main(void) { | |
| //URI ONLINE JUDGE 1759 | |
| int a,i; | |
| scanf("%d", &a); | |
| for (i = 0;i < a-1;i++) | |
| printf("Ho "); | |
| if(i==a-1) | |
| printf("Ho!"); |
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 <stdio.h> | |
| int main(void) { | |
| //URI ONLINE JUDGE 1589 | |
| int a,r1,r2,i; | |
| scanf("%d", &a); | |
| for (i = 0;i < a;i++) | |
| { | |
| scanf("%d %d", &r1, &r2); | |
| int r3 = ((r1 * 2) + (r2 * 2)) / 2; |
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 <stdio.h> | |
| int main() { | |
| //URI ONLINE JUDGE 1564 | |
| int a; | |
| while (scanf("%d", &a)!=EOF) | |
| { | |
| if (a == 0) | |
| printf("vai ter copa!\n"); | |
| else if(a>0) |
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 <stdio.h> | |
| int main(void) { | |
| // URI ONLINE JUDGE Problem solving 1557 | |
| int a, i, j,c; | |
| for (;;) | |
| { | |
| int k = 1; | |
| scanf("%d", &a); | |
| if (a == 0)break; |
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 <stdio.h> | |
| int main(void) { | |
| //URI ONLINE JUDGE Problem Solving 1534 | |
| int a[70][70], i, j, n; | |
| while (scanf("%d", &n)!=EOF) | |
| { | |
| for (i = 0;i < n;i++) |