Submission #512654

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5126542022-01-16 15:37:46David_MMalnaRISC (COI21_malnarisc)C++14
100 / 100
1 ms332 KiB
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define FF first.first
#define FS first.second
#define pb push_back
using namespace std;
ll n, T=1;
vector <pii> v[1000];
void add(int x, int y, int t){
x++; y++;
if(x>n || y>n)return;
v[t].pb({x, y});T=t;
}
int merge(int l, int r, int t){
int m=l+r>>1, e=r-l>>1;
while(e){
for (int i=l; i<r; i++)if((i/e-m/e)&1 && i+e<r)add(i, i+e, t);
e>>=1;
t++;
}
return t;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

malnarisc.cpp: In function 'int merge(int, int, int)':
malnarisc.cpp:22:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   22 |     int m=l+r>>1, e=r-l>>1;
      |           ~^~
malnarisc.cpp:22:22: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   22 |     int m=l+r>>1, e=r-l>>1;
      |                     ~^~
malnarisc.cpp: In function 'int solve(int, int, int)':
malnarisc.cpp:35:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   35 |     tt=solve(l, l+r>>1, t);
      |                 ~^~
malnarisc.cpp:36:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   36 |     tt=solve(l+r>>1, r, t);
      |              ~^~
malnarisc.cpp: In function 'void output()':
malnarisc.cpp:46:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   46 |         for(auto [x,y]:v[i])cout<<"CMPSWP R"<<x<<" R"<<y<<" ";
      |                  ^
malnarisc.cpp: At global scope:
malnarisc.cpp:51:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   51 | main(){ios_base::sync_with_stdio(false), cin.tie(0);
      | ^~~~
#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...
#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...