목록알고리즘문제들/codingame (3)
VioletaBabel
123456789101112131415161718192021222324#include #include #include #include using namespace std;int main(){ int n, p = 5527, m = -5527, result; cin >> n; cin.ignore(); for (int i = 0; i > t; cin.ignore(); if(t>0) p = (tm) ? t : m; } if(p == 5527 && m == -5527) result = 0; else result = (p > (m*(-1))) ? m : p; cout
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include #include #include #include using namespace std;int main(){ int lightX; int lightY; int initialTX; int initialTY; cin >> lightX >> lightY >> initialTX >> initialTY; cin.ignore(); while (1) { int remainingTurns; cin >> remainingTurns; cin.ignore(); if(initialT..
123456789101112131415161718192021222324252627#include #include #include #include using namespace std;int main(){ int mh[8], target, th; while (1) { target = 0; th = 0; for (int i = 0; i > mountainH; cin.ignore(); mh[i] = mountainH; } for(int i = 0; i th) { target = i; th = mh[i]; } cout