summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Naik2018-05-10 00:17:38 -0400
committerAditya Naik2018-05-10 00:17:38 -0400
commit56a296a51e95cf2b3164d15287f5ad445d167db6 (patch)
treec1961198a1ff8f7f24f3ecccbc49150acdbb728a
parent631ca6817d552db1725c7d6a445705f709302139 (diff)
more reorg
-rwxr-xr-x10141/rfpbin63128 -> 0 bytes
-rwxr-xr-x12060/averagebin35696 -> 0 bytes
-rwxr-xr-x12085/mobilebin77120 -> 0 bytes
-rwxr-xr-x556/amazingbin102112 -> 0 bytes
-rw-r--r--556/backup126
-rwxr-xr-xamazing/amazingbin102112 -> 0 bytes
-rw-r--r--amazing/amazing.cpp163
-rw-r--r--amazing/amazing.in108
-rw-r--r--amazing/amazing.py4
-rw-r--r--amazing/backup126
-rwxr-xr-xaverage/averagebin35696 -> 0 bytes
-rw-r--r--average/average.cpp119
-rw-r--r--average/average.in8
-rw-r--r--lonesome/lonesome.cpp38
-rwxr-xr-xrfp/rfpbin63128 -> 0 bytes
-rw-r--r--rfp/rfp.cpp37
-rw-r--r--rfp/rfp.in32
17 files changed, 0 insertions, 761 deletions
diff --git a/10141/rfp b/10141/rfp
deleted file mode 100755
index d71b577..0000000
--- a/10141/rfp
+++ /dev/null
Binary files differ
diff --git a/12060/average b/12060/average
deleted file mode 100755
index 557795a..0000000
--- a/12060/average
+++ /dev/null
Binary files differ
diff --git a/12085/mobile b/12085/mobile
deleted file mode 100755
index d2a44e4..0000000
--- a/12085/mobile
+++ /dev/null
Binary files differ
diff --git a/556/amazing b/556/amazing
deleted file mode 100755
index 9a65934..0000000
--- a/556/amazing
+++ /dev/null
Binary files differ
diff --git a/556/backup b/556/backup
deleted file mode 100644
index 2ffcb12..0000000
--- a/556/backup
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <iostream>
-#include <string>
-#include <vector>
-using namespace std;
-/*
-rows
-j 0 1 2 3 4
-i
-0 <0 1 0 1 0>
-1 <0 1 0 1 0>
-2 <0 0 0 0 0>
- */
-// struct sq{
-// sq* N;
-// sq* S;
-// sq* E;
-// sq* W;
-// int count;
-// };
-
-
-char turn_left(char);
-char turn_right(char);
-
-int main(){
- int b, w, count[100][100]={0};
- vector<char> sq[100];
- string s;
-
- cin>>b>>w;
- while(b>0){
- for(int i=0;i<b;i++){
- cin>>s;
- for(int j=0;j<w;j++)
- sq[i];
- }
-
- int j = 0, i=b-1;
- int wallj = 0, walli=b;
- char dir='E';
- bool returned=false;
-
- while(!returned){
- count[i][j]++;
-
- if(sq[walli][wallj]==0)
- dir = turn_right(dir);
-
- if(dir=='E'){
- if(j+1<w && sq[i][j+1]=='0'){
- j++;
- wallj++;
- }
- else
- dir = turn_left(dir);
- }
- else if(dir=='N'){
- if(i-1>=0 && sq[i-1][j]=='0'){
- i--;
- walli--;
- }
- else
- dir = turn_left(dir);
- }
- else if(dir=='W'){
- if(j-1>=0 && sq[i][j-1]=='0'){
- j--;
- wallj--;
- }
- else
- dir = turn_left(dir);
- }
- else if(dir=='S'){
- if(i+1<b && sq[i+1][j]=='0'){
- i++;
- walli++;
- }
- else
- dir = turn_left(dir);
- }
-
- if(i==b-1 && j==0)
- returned = true;
- }
-
- int visited[5]={0};
- for(int i=0; i<b; i++){
- for(int j=0; j<w; j++){
- if(count[i][j]>4)
- continue;
- else if(sq[i][j]=='0')
- visited[count[i][j]]++;
- }
- }
- for(int k=0; k<5; k++)
- cout<<visited[k]<<" ";
- cout<<endl;
- cin>>b>>w;
- }
-}
-
-char turn_left(char dir){
- char new_dir;
- if(dir=='E')
- new_dir = 'N';
- else if(dir=='N')
- new_dir = 'W';
- else if(dir=='W')
- new_dir = 'S';
- else if(dir == 'S')
- new_dir = 'E';
- return new_dir;
-}
-
-char turn_right(char dir){
- char new_dir;
- if(dir=='E')
- new_dir = 'S';
- else if(dir=='N')
- new_dir = 'E';
- else if(dir=='W')
- new_dir = 'N';
- else if(dir == 'S')
- new_dir = 'W';
- return new_dir;
-}
diff --git a/amazing/amazing b/amazing/amazing
deleted file mode 100755
index 9a65934..0000000
--- a/amazing/amazing
+++ /dev/null
Binary files differ
diff --git a/amazing/amazing.cpp b/amazing/amazing.cpp
deleted file mode 100644
index e9bc8d6..0000000
--- a/amazing/amazing.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-#include <iostream>
-#include <string>
-#include <vector>
-#include <iomanip>
-using namespace std;
-/*
-rows
-j 0 1 2 3 4
-i
-0 <0 1 0 1 0>
-1 <0 1 0 1 0>
-2 <0 0 0 0 0>
- */
-// struct sq{
-// sq* N;
-// sq* S;
-// sq* E;
-// sq* W;
-// int count;
-// };
-
-
-char turn_left(char);
-char turn_right(char);
-
-int main(){
- int b, w, count[100][100]={0};
- vector<char> sq[100];
- string s;
-
- cin>>b>>w;
- while(b>0){
- int count[100][100]={0};
- vector<char> sq[100];
- string s;
-
- for(int i=0;i<b;i++){
- cin>>s;
- for(int j=0;j<w;j++)
- sq[i].push_back(s[j]);
- }
-
- int j = 0, i=b-1;
- int wallj = 0, walli=b;
- char dir='E';
- bool returned=false;
-
- while(!returned){
- if((walli<b && walli>=0) && (wallj>=0 && wallj<w))
- if(sq[walli][wallj]=='0'){
- if(dir=='S'){
- walli--;
- wallj++;
- }
- else if(dir=='W'){
- walli++;
- wallj++;
- }
- else if(dir=='N'){
- walli++;
- wallj--;
- }
- else if(dir=='E'){
- walli--;
- wallj--;
- }
- dir = turn_right(dir);
- }
-
- if(dir=='E'){
- if(j+1<w && sq[i][j+1]=='0'){
- j++;
- wallj++;
- count[i][j]++;
- }
- else{
- dir = turn_left(dir);
- walli--;
- wallj++;
- }
- }
- else if(dir=='N'){
- if(i-1>=0 && sq[i-1][j]=='0'){
- i--;
- walli--;
- count[i][j]++;
- }
- else{
- dir = turn_left(dir);
- walli--;
- wallj--;
- }
- }
- else if(dir=='W'){
- if(j-1>=0 && sq[i][j-1]=='0'){
- j--;
- wallj--;
- count[i][j]++;
- }
- else{
- dir = turn_left(dir);
- walli++;
- wallj--;
- }
- }
- else if(dir=='S'){
- if(i+1<b && sq[i+1][j]=='0'){
- i++;
- walli++;
- count[i][j]++;
- }
- else{
- dir = turn_left(dir);
- walli++;
- wallj++;
- }
- }
-
- if(i==b-1 && j==0)
- returned = true;
- }
-
- int visited[5]={0};
- for(int i=0; i<b; i++){
- for(int j=0; j<w; j++){
- if(count[i][j]>4)
- continue;
- else if(sq[i][j]=='0')
- visited[count[i][j]]++;
- }
- }
- for(int k=0; k<5; k++)
- cout<<right<<setw(3)<<visited[k];
- cout<<endl;
- cin>>b>>w;
- }
-}
-
-char turn_left(char dir){
- char new_dir;
- if(dir=='E')
- new_dir = 'N';
- else if(dir=='N')
- new_dir = 'W';
- else if(dir=='W')
- new_dir = 'S';
- else if(dir == 'S')
- new_dir = 'E';
- return new_dir;
-}
-
-char turn_right(char dir){
- char new_dir;
- if(dir=='E')
- new_dir = 'S';
- else if(dir=='N')
- new_dir = 'E';
- else if(dir=='W')
- new_dir = 'N';
- else if(dir == 'S')
- new_dir = 'W';
- return new_dir;
-}
diff --git a/amazing/amazing.in b/amazing/amazing.in
deleted file mode 100644
index 52d676a..0000000
--- a/amazing/amazing.in
+++ /dev/null
@@ -1,108 +0,0 @@
-11 10
-0010000100
-0100000001
-0100000100
-1010000000
-0001000000
-0000000000
-0011011000
-0010000001
-0101000000
-0000000011
-0010100101
-2 24
-001100010000000000000000
-000010101100101000001010
-12 28
-1000100000101000010000100100
-0001001000000001001001000010
-0000000000000100000001000100
-1000011100000000000100000001
-0001000100010010000011000010
-0000100000000000000001101000
-0000000000000000001010000000
-0100000000010010000000100000
-0001000000110000101010100100
-0000110000001101000000001000
-0000100000111001000000100000
-0001101100000010111010111100
-29 6
-000000
-111000
-110011
-000000
-110011
-000000
-000100
-101000
-000000
-000100
-100001
-000100
-010000
-001010
-000000
-001010
-100110
-001100
-110000
-001000
-000001
-000100
-100000
-000000
-001000
-001100
-000000
-010000
-000000
-8 27
-110100000100000100010000000
-000000000001010101010000001
-000110110000010000010000001
-000100100001000001000000000
-000000001000111101000010010
-001000100100110001000010100
-001000000011000000000101000
-000000000000000100000001000
-11 24
-010000100000000001001001
-000000000101001000000110
-010000000010000000000101
-010010001100000001000001
-000100000000000000100100
-000100011010100000101000
-001001000100000000100101
-001001110000000000000001
-110011001000100001000000
-000000001000100100110100
-000010100000000000011001
-8 29
-01000110000000000000010000000
-11010101000000000011000000000
-00000000100100100000000000000
-11000100011000000000001010000
-00000001111000100000000000000
-00000011000000000000100100100
-00011100000111001100100000000
-00110000001000100000100011100
-5 3
-001
-010
-100
-000
-000
-9 3
-011
-000
-011
-000
-000
-000
-000
-000
-000
-2 11
-00000000001
-00111001000
-0 0 \ No newline at end of file
diff --git a/amazing/amazing.py b/amazing/amazing.py
deleted file mode 100644
index 6df6194..0000000
--- a/amazing/amazing.py
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-class square:
-
diff --git a/amazing/backup b/amazing/backup
deleted file mode 100644
index 2ffcb12..0000000
--- a/amazing/backup
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <iostream>
-#include <string>
-#include <vector>
-using namespace std;
-/*
-rows
-j 0 1 2 3 4
-i
-0 <0 1 0 1 0>
-1 <0 1 0 1 0>
-2 <0 0 0 0 0>
- */
-// struct sq{
-// sq* N;
-// sq* S;
-// sq* E;
-// sq* W;
-// int count;
-// };
-
-
-char turn_left(char);
-char turn_right(char);
-
-int main(){
- int b, w, count[100][100]={0};
- vector<char> sq[100];
- string s;
-
- cin>>b>>w;
- while(b>0){
- for(int i=0;i<b;i++){
- cin>>s;
- for(int j=0;j<w;j++)
- sq[i];
- }
-
- int j = 0, i=b-1;
- int wallj = 0, walli=b;
- char dir='E';
- bool returned=false;
-
- while(!returned){
- count[i][j]++;
-
- if(sq[walli][wallj]==0)
- dir = turn_right(dir);
-
- if(dir=='E'){
- if(j+1<w && sq[i][j+1]=='0'){
- j++;
- wallj++;
- }
- else
- dir = turn_left(dir);
- }
- else if(dir=='N'){
- if(i-1>=0 && sq[i-1][j]=='0'){
- i--;
- walli--;
- }
- else
- dir = turn_left(dir);
- }
- else if(dir=='W'){
- if(j-1>=0 && sq[i][j-1]=='0'){
- j--;
- wallj--;
- }
- else
- dir = turn_left(dir);
- }
- else if(dir=='S'){
- if(i+1<b && sq[i+1][j]=='0'){
- i++;
- walli++;
- }
- else
- dir = turn_left(dir);
- }
-
- if(i==b-1 && j==0)
- returned = true;
- }
-
- int visited[5]={0};
- for(int i=0; i<b; i++){
- for(int j=0; j<w; j++){
- if(count[i][j]>4)
- continue;
- else if(sq[i][j]=='0')
- visited[count[i][j]]++;
- }
- }
- for(int k=0; k<5; k++)
- cout<<visited[k]<<" ";
- cout<<endl;
- cin>>b>>w;
- }
-}
-
-char turn_left(char dir){
- char new_dir;
- if(dir=='E')
- new_dir = 'N';
- else if(dir=='N')
- new_dir = 'W';
- else if(dir=='W')
- new_dir = 'S';
- else if(dir == 'S')
- new_dir = 'E';
- return new_dir;
-}
-
-char turn_right(char dir){
- char new_dir;
- if(dir=='E')
- new_dir = 'S';
- else if(dir=='N')
- new_dir = 'E';
- else if(dir=='W')
- new_dir = 'N';
- else if(dir == 'S')
- new_dir = 'W';
- return new_dir;
-}
diff --git a/average/average b/average/average
deleted file mode 100755
index 557795a..0000000
--- a/average/average
+++ /dev/null
Binary files differ
diff --git a/average/average.cpp b/average/average.cpp
deleted file mode 100644
index 5627b61..0000000
--- a/average/average.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-#include <iostream>
-#include <cmath>
-#include <iomanip>
-using namespace std;
-
-int find_gcd(int a, int b);
-void printer(int c, int q, int num, int deno);
-
-int main(){
- int n, cnum=0;
- cin>>n;
-
- while(n>0){
- cnum++;
- int nm, sum=0;
- for(int i=0; i<n; i++){
- cin>>nm;
- sum += nm;
- }
- int gcd;
- int deno, num, q;
- if(abs(sum)>=n){
- if(sum % n == 0){
- num = sum/n;
- deno = 0;
- q = 0;
- }
- else{
- gcd = find_gcd(sum,n);
- while(gcd != 1){
- sum /= gcd;
- n /= gcd;
- gcd = find_gcd(sum,n);
- }
- q = (sum-(sum%n))/n;
- num = sum%n;
- deno = n;
- }
- }
- else{ //abs(sum)<n
- gcd = find_gcd(n,sum);
- while(gcd != 1){
- sum /= gcd;
- n /= gcd;
- gcd = find_gcd(n,sum);
- }
- q = 0;
- num = sum;
- deno = n;
- }
- printer(cnum, q, num, deno);
- cin >> n;
-
- }
-}
-
-void printer(int c, int q, int num, int deno){
- int dl=0, ql=0, nl=0, x=deno, y=q, z = num;
- while (x /= 10)
- dl++;
- while(y /= 10)
- ql++;
- while(z /= 10)
- nl++;
- if(deno == 1 || deno == 0){
- if(num<0)
- cout<<"Case "<<c<<":\n"<<"- "<<abs(num)<<endl;
- else
- cout<<"Case "<<c<<":\n"<<num<<endl;
- }
- else if(q == 0){
- if(num<0 || deno<0){
- cout<<"Case "<<c<<":\n";
- for(int k=0;k<dl+2;k++) cout<<" ";
- cout<<abs(num)<<endl;
- cout<<"- ";
- for(int k=0;k<dl+1;k++) cout<<"-";
- cout<<endl;
- cout<<" "<<abs(deno)<<endl;
- }
- else{
- cout<<"Case "<<c<<":\n";
- for(int k=0;k<dl;k++) cout<<" ";
- cout<<abs(num)<<endl;
- for(int k=0;k<dl+1;k++) cout<<"-";
- cout<<endl;
- cout<<abs(deno)<<endl;
- }
- }
- else{
- if(num<0 || deno<0){
- cout<<"Case "<<c<<":\n";
- for(int k=0;k<dl+2+ql-nl+1;k++) cout<<" ";
- cout<<abs(num)<<endl;
- cout<<"- "<<abs(q);
- for(int k=0;k<dl+1;k++) cout<<"-";
- cout<<endl;
- for(int k=0;k<3+ql;k++) cout<<" ";
- cout<<abs(deno)<<endl;
- }
- else{
- cout<<"Case "<<c<<":\n";
- for(int k=0;k<dl+1+ql-nl;k++) cout<<" ";
- cout<<num<<endl;
- cout<<q;
- for(int k=0;k<dl+1;k++) cout<<"-";
- cout<<endl;
- for(int k=0;k<2+ql-1;k++) cout<<" ";
- cout<<deno<<endl;
- }
- }
-}
-
-int find_gcd(int a, int b){
- if(b==0)
- return a;
- else
- return find_gcd(b, a % b);
-}
diff --git a/average/average.in b/average/average.in
deleted file mode 100644
index 6ae00d8..0000000
--- a/average/average.in
+++ /dev/null
@@ -1,8 +0,0 @@
-2 -1 1
-100 4 -1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1
-100 -8 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1
-1 -10000
-1 10000
-100 -909 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000
-100 -99 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000
-0
diff --git a/lonesome/lonesome.cpp b/lonesome/lonesome.cpp
deleted file mode 100644
index 8c13b11..0000000
--- a/lonesome/lonesome.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <iostream>
-using namespace std;
-
-int main()
-{
- int dur;
- cin>>dur;
- while(dur>0)
- {
- int deprecs, months, depmonth, i;
- double dwp, amt, val, cur_depval, iments, deps[100]={0.0};
- bool nend;
-
- cin>>dwp>>amt>>deprecs;
- for(i=0;i<deprecs;i++)
- cin>>depmonth>>deps[depmonth];
-
- val = dwp+amt;
- iments = amt/dur;
- nend = true;
-
- for(months=0; ; ++months)
- {
- if(deps[months]>0)
- cur_depval=deps[months];
- val -= val*cur_depval;
- if(val>amt)
- break;
- amt -= iments;
- }
- if(months==1)
- cout<<months<<" month\n";
- else
- cout<<months<<" months\n";
- cin>>dur;
- }
- return 0;
-}
diff --git a/rfp/rfp b/rfp/rfp
deleted file mode 100755
index d71b577..0000000
--- a/rfp/rfp
+++ /dev/null
Binary files differ
diff --git a/rfp/rfp.cpp b/rfp/rfp.cpp
deleted file mode 100644
index 2a4f918..0000000
--- a/rfp/rfp.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <iostream>
-#include <string>
-using namespace std;
-
-int main(){
- float req, pro;
- cin>>req>>pro;
- int rfpnum=0;
- while(req>0)
- {
- int i, j, k;
- float cost,curcost=1000000000, comp, curcomp=0, numcomp;
- string trash, curname, name;
- ++rfpnum;
- for(i=0; i<=req; i++)
- getline(cin, trash);
-
- for(j=0; j<pro; j++){
- getline(cin, name);
- cin>>cost>>numcomp;
- comp = numcomp/req;
-
- if(comp>curcomp || (comp==curcomp && cost<curcost)){
- curname = name;
- curcomp = comp;
- curcost = cost;
- }
-
- for(k=0;k<=numcomp;k++)
- getline(cin, trash);
- }
- if(rfpnum>1) cout<<"\n";
- cout<<"RFP #"<<rfpnum<<"\n"<<curname<<"\n";
- cin>>req>>pro;
- }
- return 0;
-}
diff --git a/rfp/rfp.in b/rfp/rfp.in
deleted file mode 100644
index f0bc2d6..0000000
--- a/rfp/rfp.in
+++ /dev/null
@@ -1,32 +0,0 @@
-6 4
-engine
-brakes
-tires
-ashtray
-vinyl roof
-trip computer
-Chevrolet
-20000.00 3
-engine
-tires
-brakes
-Cadillac
-70000.00 4
-ashtray
-vinyl roof
-trip computer
-engine
-Hyundai
-10000.00 3
-engine
-tires
-ashtray
-Lada
-6000.00 1
-tires
-1 1
-coffee
-Starbucks
-1.50 1
-coffee
-0 0 \ No newline at end of file