Submission #1117226

#TimeUsernameProblemLanguageResultExecution timeMemory
1117226pokmui9909Counting Mushrooms (IOI20_mushrooms)C++17
25 / 100
194 ms504 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; using ll = long long; #define x first #define y second int count_mushrooms(int N){ ll Ans = 1; for(ll i = 1; i < N; i += 2){ if(i == N - 1){ Ans += 1 - use_machine((vector<int>){0, i}); } else { Ans += 2 - use_machine((vector<int>){i, 0, i + 1}); } } return Ans; }

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:13:53: warning: narrowing conversion of 'i' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   13 |             Ans += 1 - use_machine((vector<int>){0, i});
      |                                                     ^
mushrooms.cpp:13:53: warning: narrowing conversion of 'i' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
mushrooms.cpp:15:50: warning: narrowing conversion of 'i' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   15 |             Ans += 2 - use_machine((vector<int>){i, 0, i + 1});
      |                                                  ^
mushrooms.cpp:15:50: warning: narrowing conversion of 'i' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
mushrooms.cpp:15:58: warning: narrowing conversion of '(i + 1)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   15 |             Ans += 2 - use_machine((vector<int>){i, 0, i + 1});
      |                                                        ~~^~~
mushrooms.cpp:15:58: warning: narrowing conversion of '(i + 1)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
#Verdict Execution timeMemoryGrader output
Fetching results...