Submission #362014

#TimeUsernameProblemLanguageResultExecution timeMemory
362014SiddhantDetecting Molecules (IOI16_molecules)C++98
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef pair<int, int> pi; #define F first #define S second #define PB push_back #define MP make_pair #define pop_front(v) v.erase(v.begin()) #define REP(i, a, b) for (int i=a; i<=b; i++) #define REPn(i, a, b) for (int i=a; i>=b; i--) #define FOR(i, n) REP(i, 0, n-1) #define FORn(j, n) REPn(j, n-1, 0) #define all(v) v.begin(), v.end() #define allR(v) v.rbegin(), v.rend() void produceCases() { int n=rand()%100+1; int a1=rand()%1000+1, a2=rand()%1000+1; int l = min(a1, a2), u=max(a2, a1); cout<<n<<" "<<l<<" "<<u<<endl; int kk = rand()%1000; FOR(i, n) { cout<<kk+rand()%2<<" "; } cout<<endl; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("input.txt", "w", stdout); srand(time(NULL)); int totalCases=100; cout<<totalCases<<endl; REP(i, 1, totalCases) { produceCases(); } }

Compilation message (stderr)

molecules.cpp: In function 'int main()':
molecules.cpp:38:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   38 |     freopen("input.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccX8FH6M.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccpmyIvL.o:molecules.cpp:(.text.startup+0x0): first defined here
/tmp/ccX8FH6M.o: In function `main':
grader.cpp:(.text.startup+0x139): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status