Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
nitko12 committed Jun 8, 2022
1 parent ca43098 commit 485eaf3
Show file tree
Hide file tree
Showing 253 changed files with 78,026 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/usr/local/bin/gcc-11",
"cStandard": "gnu17",
"cppStandard": "gnu++20",
"intelliSenseMode": "macos-gcc-x64",
"compilerArgs": [
"-std=c++17"
]
}
],
"version": 4
}
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "g++ - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "C/C++: g++ build active file"
}
]
}
113 changes: 113 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"files.associations": {
"ctime": "cpp",
"ostream": "cpp",
"complex": "cpp",
"cmath": "cpp",
"cstdlib": "cpp",
"iostream": "cpp",
"__split_buffer": "cpp",
"deque": "cpp",
"string": "cpp",
"vector": "cpp",
"numeric": "cpp",
"random": "cpp",
"algorithm": "cpp",
"queue": "cpp",
"stack": "cpp",
"tuple": "cpp",
"array": "cpp",
"utility": "cpp",
"chrono": "cpp",
"*.tcc": "cpp",
"istream": "cpp",
"__bit_reference": "cpp",
"__bits": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__functional_base": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__string": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstring": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iterator": "cpp",
"limits": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"optional": "cpp",
"ratio": "cpp",
"semaphore": "cpp",
"set": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"thread": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"memory_resource": "cpp",
"stop_token": "cpp",
"valarray": "cpp",
"cassert": "cpp",
"any": "cpp",
"barrier": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"cinttypes": "cpp",
"codecvt": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"coroutine": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"future": "cpp",
"iomanip": "cpp",
"latch": "cpp",
"list": "cpp",
"regex": "cpp",
"scoped_allocator": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"typeindex": "cpp",
"unordered_set": "cpp",
"variant": "cpp",
"cuchar": "cpp",
"source_location": "cpp",
"ranges": "cpp",
"syncstream": "cpp",
"filesystem": "cpp"
},
"fortran.ignoreWarning.fortls": true
}
29 changes: 29 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-fdiagnostics-color=always",
"-std=c++17",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
Binary file added natjecanje/pizza/a.out
Binary file not shown.
29 changes: 29 additions & 0 deletions natjecanje/pizza/checker.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "testlib.h"

std::string upper(std::string sa)
{
for (size_t i = 0; i < sa.length(); i++)
if ('a' <= sa[i] && sa[i] <= 'z')
sa[i] = sa[i] - 'a' + 'A';
return sa;
}

int main(int argc, char *argv[])
{
setName("DA or NE (case insensetive)");
registerTestlibCmd(argc, argv);

std::string ja = upper(ans.readWord());
std::string pa = upper(ouf.readWord());

if (pa != "DA" && pa != "NE")
quitf(_pe, "DA or NE expected, but %s found", pa.c_str());

if (ja != "DA" && ja != "NE")
quitf(_fail, "DA or NE expected in answer, but %s found", ja.c_str());

if (ja != pa)
quitf(_wa, "expected %s, found %s", ja.c_str(), pa.c_str());

quitf(_ok, "answer is %s", ja.c_str());
}
20 changes: 20 additions & 0 deletions natjecanje/pizza/generator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "testlib.h"
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
registerGen(argc, argv, 1);

for (int i = 1; i <= 100; ++i)
{
startTest(i);

cout << 100. * (rnd.next(1, 1000) / 1000.) << " "
<< 100. * (rnd.next(1, 1000) / 1000.) << endl;

cout << rnd.next(1, 100) << endl;
}

return 0;
}
15 changes: 15 additions & 0 deletions natjecanje/pizza/solution.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
double r1, r2;
int n;

cin >> r1 >> r2 >> n;

cout << (n * r1 * r1 * M_PI > r2 * r2 * M_PI ? "DA" : "NE") << endl;

return 0;
}
Loading

0 comments on commit 485eaf3

Please sign in to comment.