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 a="GBIV"; string b; int n; | |
| cin>>n; | |
| if (n<7) | |
| cout<<"Wrong!"; | |
| else cout<<"ROYGBIV"; | |
| n=n-7; |
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, a, index1[100001]; | |
| cin>>n; | |
| for (int i = 1; i <= n; ++i) | |
| { | |
| cin>>a; | |
| index1[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() { | |
| char digits[100001]; | |
| cin>>digits; | |
| int times=0; | |
| if (digits[1] != 0) | |
| { | |
| int digitsum=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
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int n,m; | |
| unsigned long long count1=0; | |
| unsigned long long count2=0; | |
| cin>>n>>m; | |
| vector< vector<int> >container(m,vector<int>(2)); | |
| 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
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int n,in; | |
| cin>>n>>in; | |
| int a[n]; | |
| for (int i=1;i<=n;i++) | |
| cin>>a[i]; | |
| int ans=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
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int num; | |
| cin>>num; | |
| char a[num]; | |
| for(int i=0;i<num;i++) | |
| cin>>a[i]; | |
| int allin=count(a,a+num,'A'); |
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,y=0,x,count1=0,count2=0; | |
| cin>>num; | |
| int a[num]; | |
| for(int i=0;i<num;i++) | |
| cin>>a[i]; | |
| for(int i=0;i<num;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 num1,num2; | |
| string line1,line2; | |
| cin>>num1; | |
| vector<string>lang(num1), k1(num1); | |
| for(int i=0;i<num1;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; | |
| int main() | |
| { | |
| string str1; | |
| int index=0,balance=true,a; | |
| char top; | |
| cin>>str1; | |
| stack<char>s1; | |
| while(index<str1.length()) |
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 max(int a, int b) { return (a > b)? a : b; } | |
| int knapSack(int W, int wt[], int n) | |
| { | |
| int i, w; | |
| int K[n+1][W+1]; | |
| for (i = 0; i <= n; i++) | |
| { | |
| for (w = 0; w <= W; w++) |