Submission #420685

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4206852021-06-08 13:18:33PyqeMalnaRISC (COI21_malnarisc)C++14
100 / 100
1 ms292 KiB
#include <bits/stdc++.h>
using namespace std;
long long n,nn;
bool bad;
void ad(long long x,long long w)
{
if(x+(1ll<<w)<n)
{
if(bad)
{
printf(" ");
}
printf("CMPSWP R%lld R%lld",x+1,x+(1ll<<w)+1);
bad=1;
}
}
int main()
{
long long i,j,r,c=0;
scanf("%lld",&n);
for(nn=1;nn<n;nn*=2,c++);
printf("%lld\n",c*(c+1)/2);
for(i=1;1ll<<i<=nn;i++)
{
bad=0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

malnarisc.cpp: In function 'int main()':
malnarisc.cpp:33:13: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   33 |    if(!(j>>i-1&1))
      |            ~^~
malnarisc.cpp:44:14: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   44 |     if(!((r^r+(1ll<<j))>>i&1)&&(r>>j&1))
      |             ~^~~~~~~~~
malnarisc.cpp:25:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |  scanf("%lld",&n);
      |  ~~~~~^~~~~~~~~~~
#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...