Submission #1054613

#TimeUsernameProblemLanguageResultExecution timeMemory
1054613LittleOrangeCounting Mushrooms (IOI20_mushrooms)C++17
10 / 100
128 ms596 KiB
#include "mushrooms.h" #include<bits/stdc++.h> using namespace std; using ll = long long; int count_mushrooms(int n) { ll ans = 1; ll cur = 1; for(ll i = 1;i<n;i++){ cur^=use_machine({i-1,i}); ans += cur; } return ans; }

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:10:22: warning: narrowing conversion of '(i - 1)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   10 |   cur^=use_machine({i-1,i});
      |                     ~^~
mushrooms.cpp:10:22: warning: narrowing conversion of '(i - 1)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
mushrooms.cpp:10:25: warning: narrowing conversion of 'i' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   10 |   cur^=use_machine({i-1,i});
      |                         ^
mushrooms.cpp:10:25: warning: narrowing conversion of 'i' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
#Verdict Execution timeMemoryGrader output
Fetching results...