Submission #28177

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
281772017-07-15 14:15:12대회할수있으려나 (#71)The Ant and The Bitcoin (FXCUP2_ant)C++98
0 / 1
0 ms5928 KiB
#include <bits/stdc++.h>
using namespace std;
struct info
{
int pos, idx;
char dir;
};
bool cmp1(info a, info b) {return a.pos < b.pos;}
bool cmp2(info a, info b) {return a.idx < b.idx;}
info arr[200009];
pair<int, int> res[200009];
int main()
{
int n,l,t;
scanf("%d %d %d",&n,&l,&t);
for(int i=1; i<=n; i++) {
scanf("%d %c", &arr[i].pos, &arr[i].dir);
arr[i].idx = i;
}
sort(arr+1, arr+n+1, cmp1);
for(int i=1; i<=n; i++) {
int pos = arr[i].pos;
char dir = arr[i].dir;
if(dir == 'L') pos -= t;
if(dir == 'R') pos += t;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

ant.cpp: In function 'int main()':
ant.cpp:19:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d",&n,&l,&t);
                               ^
ant.cpp:21:49: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %c", &arr[i].pos, &arr[i].dir);
                                                 ^
ant.cpp:38:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&bit);
                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...