Browse Source

Update test.sh to ouput compilation status and update std namespace location

square-pasture
Abheek Dhawan 3 years ago
parent
commit
750b1be78f
  1. 3
      codeforces/Caps Lock/index.cpp
  2. 3
      codeforces/Next Round/index.cpp
  3. 3
      codeforces/Soldier and Bananas/index.cpp
  4. 3
      codeforces/Team/index.cpp
  5. 3
      codeforces/Watermelon/index.cpp
  6. 3
      codeforces/Way Too Long Words/index.cpp
  7. 2
      test.sh
  8. 3
      usaco/Breed Counting/index.cpp
  9. 3
      usaco/Mixing Milk/index.cpp
  10. 3
      usaco/Shell Game/index.cpp
  11. 11
      usaco/Teleportation/index.cpp

3
codeforces/Caps Lock/index.cpp

@ -1,7 +1,6 @@
using namespace std;
#include <iostream> #include <iostream>
#include <string> #include <string>
using namespace std;
string parseString(string n) { string parseString(string n) {
string m = n; string m = n;

3
codeforces/Next Round/index.cpp

@ -1,6 +1,5 @@
using namespace std;
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
int n, k; int n, k;

3
codeforces/Soldier and Bananas/index.cpp

@ -1,6 +1,5 @@
using namespace std;
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
int k, n, total_cost; int k, n, total_cost;

3
codeforces/Team/index.cpp

@ -1,6 +1,5 @@
using namespace std;
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
int n; int n;

3
codeforces/Watermelon/index.cpp

@ -1,6 +1,5 @@
using namespace std;
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
int n; int n;

3
codeforces/Way Too Long Words/index.cpp

@ -1,7 +1,6 @@
using namespace std;
#include <iostream> #include <iostream>
#include <string.h> #include <string.h>
using namespace std;
int main() { int main() {
int n; int n;

2
test.sh

@ -4,4 +4,6 @@ FILES=*/*/*.cpp
for f in $FILES for f in $FILES
do do
gcc "$f" -lstdc++ -o /dev/null gcc "$f" -lstdc++ -o /dev/null
status=$?
[ $status -eq 0 ] && echo "$f was compiled successfully" || echo "Compilation of $f failed"
done done

3
usaco/Breed Counting/index.cpp

@ -1,7 +1,6 @@
using namespace std;
#include <cstdio> #include <cstdio>
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
freopen("bcount.in", "r", stdin); freopen("bcount.in", "r", stdin);

3
usaco/Mixing Milk/index.cpp

@ -1,6 +1,5 @@
using namespace std;
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
freopen("mixmilk.in", "r", stdin); freopen("mixmilk.in", "r", stdin);

3
usaco/Shell Game/index.cpp

@ -1,7 +1,6 @@
using namespace std;
#include <cstdio> #include <cstdio>
#include <iostream> #include <iostream>
using namespace std;
int main() { int main() {
freopen("shell.in", "r", stdin); freopen("shell.in", "r", stdin);

11
usaco/Teleportation/index.cpp

@ -1,15 +1,16 @@
#include <iostream> #include <iostream>
using namespace std;
int a, b, x, y; int a, b, x, y;
int main() { int main() {
std::cin >> a >> b >> x >> y; cin >> a >> b >> x >> y;
int path1; int path1;
int path2; int path2;
int path3; int path3;
int ans; int ans;
path1 = std::abs(a - b); path1 = abs(a - b);
path2 = std::abs(a - x) + std::abs(y - b); path2 = abs(a - x) + abs(y - b);
path3 = std::abs(a - y) + std::abs(x - b); path3 = abs(a - y) + abs(x - b);
ans = path1; ans = path1;
if (path2 < ans) { if (path2 < ans) {
ans = path2; ans = path2;
@ -17,5 +18,5 @@ int main() {
if (path3 < ans) { if (path3 < ans) {
ans = path3; ans = path3;
} }
std::cout << ans << std::endl; cout << ans << endl;
} }

Loading…
Cancel
Save