Submission #18054

#TimeUsernameProblemLanguageResultExecution timeMemory
18054chan492811카드 역배치 (KOI15_reversal)C++98
25 / 25
0 ms1084 KiB
#include <cstdio> #include <algorithm> #define n 10 using namespace std; int arr[30]; int main(){ int i,j,a,s; for(i=1;i<=20;i++) arr[i]=i; for(i=0;i<n;i++){ scanf("%d %d",&a,&s); for(j=a;j<=(s+a)/2;j++) swap(arr[j],arr[s-j+a]); } for(i=1;i<=20;i++) printf("%d ",arr[i]); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...