Submission #17924577


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int TY,TX;

void solve() {
	int i,j,k,l,r,x,y; string s;
	x=y=0;
	string S;
	FOR(i,100) {
		cin>>TY>>TX;
		while(y<TY) y++, S.push_back('D');
		while(y>TY) y--, S.push_back('U');
		while(x<TX) x++, S.push_back('R');
		while(x>TX) x--, S.push_back('L');
		S.push_back('I');
	}
	cout<<S<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

Submission Info

Submission Time
Task A - カードの回収
User kmjp
Language C++ (GCC 9.2.1)
Score 133118
Code Size 1052 Byte
Status AC
Exec Time 8 ms
Memory 3580 KB

Compile Error

./Main.cpp: In function ‘void solve()’:
./Main.cpp:19:8: warning: unused variable ‘j’ [-Wunused-variable]
   19 |  int i,j,k,l,r,x,y; string s;
      |        ^
./Main.cpp:19:10: warning: unused variable ‘k’ [-Wunused-variable]
   19 |  int i,j,k,l,r,x,y; string s;
      |          ^
./Main.cpp:19:12: warning: unused variable ‘l’ [-Wunused-variable]
   19 |  int i,j,k,l,r,x,y; string s;
      |            ^
./Main.cpp:19:14: warning: unused variable ‘r’ [-Wunused-variable]
   19 |  int i,j,k,l,r,x,y; string s;
      |              ^
./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:7:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                            ^
./Main.cpp:38:38: note: in expansion of macro ‘FOR’
   38 |  FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
      |                                      ^~~

Judge Result

Set Name test_ALL
Score / Max Score 133118 / 200000
Status
AC × 50
Set Name Test Cases
test_ALL test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt
Case Name Status Exec Time Memory
test_00.txt AC 8 ms 3504 KB
test_01.txt AC 2 ms 3556 KB
test_02.txt AC 2 ms 3540 KB
test_03.txt AC 2 ms 3540 KB
test_04.txt AC 3 ms 3496 KB
test_05.txt AC 2 ms 3552 KB
test_06.txt AC 2 ms 3548 KB
test_07.txt AC 2 ms 3572 KB
test_08.txt AC 2 ms 3500 KB
test_09.txt AC 3 ms 3504 KB
test_10.txt AC 3 ms 3536 KB
test_11.txt AC 4 ms 3572 KB
test_12.txt AC 2 ms 3532 KB
test_13.txt AC 3 ms 3484 KB
test_14.txt AC 1 ms 3516 KB
test_15.txt AC 1 ms 3556 KB
test_16.txt AC 5 ms 3568 KB
test_17.txt AC 2 ms 3576 KB
test_18.txt AC 2 ms 3508 KB
test_19.txt AC 2 ms 3524 KB
test_20.txt AC 2 ms 3572 KB
test_21.txt AC 2 ms 3476 KB
test_22.txt AC 3 ms 3508 KB
test_23.txt AC 6 ms 3524 KB
test_24.txt AC 2 ms 3568 KB
test_25.txt AC 2 ms 3548 KB
test_26.txt AC 2 ms 3488 KB
test_27.txt AC 3 ms 3556 KB
test_28.txt AC 2 ms 3508 KB
test_29.txt AC 2 ms 3508 KB
test_30.txt AC 2 ms 3572 KB
test_31.txt AC 3 ms 3528 KB
test_32.txt AC 2 ms 3508 KB
test_33.txt AC 3 ms 3572 KB
test_34.txt AC 3 ms 3572 KB
test_35.txt AC 3 ms 3464 KB
test_36.txt AC 2 ms 3536 KB
test_37.txt AC 2 ms 3536 KB
test_38.txt AC 3 ms 3504 KB
test_39.txt AC 2 ms 3468 KB
test_40.txt AC 2 ms 3488 KB
test_41.txt AC 2 ms 3508 KB
test_42.txt AC 2 ms 3492 KB
test_43.txt AC 2 ms 3488 KB
test_44.txt AC 2 ms 3580 KB
test_45.txt AC 3 ms 3464 KB
test_46.txt AC 7 ms 3552 KB
test_47.txt AC 2 ms 3480 KB
test_48.txt AC 3 ms 3580 KB
test_49.txt AC 2 ms 3572 KB