This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
int main(void){
long N;
scanf("%d", &N);
bool is_even;
if(N%2 != 0){
is_even = false;
}
else{
is_even = true;
}
N = N/2;
if(is_even){
printf("%d", 2*N-1);
}
else{
printf("%d", N);
}
//map<long, long> q_map;
//q_map[0] = 0;
//map<pair<long, long>, bool> line_map;
//long line_count = 0;
//long i;
//for(long i=1; i<=N; i++){
// long q_i;
// q_i = (q_map[i-1]+i) % N;
// //prlongf("%d\n", q_i);
// if(q_i == 0){
// //break;
// }
// if(q_map.count(i) == 0){
// q_map[i] = q_i;
// }
// if(q_map[i-1] != q_i){
// if(line_map.count(make_pair(q_map[i-1], q_i)) == 0 && line_map.count(make_pair(q_i, q_map[i-1])) == 0){
// line_map[make_pair(q_map[i-1], q_i)] = true;
// line_count += 1;
// }
// }
//}
//printf("%ld\n", line_count);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |