Submission #28134

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
281342017-07-15 12:02:25aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (#71)The Ant and The Bitcoin (FXCUP2_ant)C++14
0 / 1
0 ms5440 KiB
#include <bits/stdc++.h>
#include <unistd.h>
#define pii pair<int,int>
#define pll pair<lld,lld>
#define pb push_back
#define lld long long
using namespace std;
lld N,where; lld L,T;
struct data{
lld x;
lld num;
}a[100002];
lld memo[100002],tmp[100002];
char s[100002][3];
lld change(lld value,char op){
lld i=0; a[i].x = value;
if(op == 'L'){
if(T <= a[i].x) a[i].x -= T;
else if(T <= a[i].x+L) a[i].x = T-a[i].x;
else a[i].x = a[i].x+L*2-T;
}else{
if(T <= L-a[i].x) a[i].x += T;
else if(T <= L*2-a[i].x) a[i].x = -a[i].x + L*2 - T;
else a[i].x = T-(L*2-a[i].x);
}
return a[i].x;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

ant.cpp: In function 'int main()':
ant.cpp:37:32: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'char (*)[3]' [-Wformat=]
   scanf("%lld %s",&a[i].x,&s[i]);
                                ^
ant.cpp:34:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld %lld",&N,&L,&T);
                                  ^
ant.cpp:37:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %s",&a[i].x,&s[i]);
                                 ^
ant.cpp:43:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&where);
                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...