Submission #903613

#TimeUsernameProblemLanguageResultExecution timeMemory
903613Tenis0206Street Lamps (APIO19_street_lamps)C++11
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; int n,q; int main() { freopen("nr.in","r",stdin); freopen("nr.out","w",stdout); srand(time(NULL)); cin>>n>>q; cout<<n<<' '<<q<<'\n'; for(int i=1;i<=n;i++) { cout<<rand() % 2; } cout<<'\n'; for(int i=1;i<=n;i++) { int tip = rand() % 2; if(tip == 0) { cout<<"toggle "; cout<<1 + rand() % n<<'\n'; } else { cout<<"query "; int st = 1 + rand() % (n + 1); int dr = 1 + rand() % (n + 1); while(st == dr) { st = 1 + rand() % (n + 1); dr = 1 + rand() % (n + 1); } if(st > dr) { swap(st,dr); } cout<<st<<' '<<dr<<'\n'; } } return 0; }

Compilation message (stderr)

street_lamps.cpp: In function 'int main()':
street_lamps.cpp:9:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     freopen("nr.in","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~
street_lamps.cpp:10:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     freopen("nr.out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...