Cod sursa(job #3245859)

Utilizator MihneaStoicaMihnea Teodor Stoica MihneaStoica Data 30 septembrie 2024 21:33:42
Problema Order Scor 90
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 2.06 kb
// "I am the true mogger."
// 					-MihneaTheMogger
// 
// prob Order
// 
// tl 25
// ml 64
// 
// LOT

#pragma GCC optimize("Ofast,unroll-loops")

#include <bits/stdc++.h>
#define FastIO ios_base::sync_with_stdio(false);\
                               cin.tie(nullptr);\
                 			  cout.tie(nullptr);
using namespace std;

#define int short
#define YES cout<<"YES"    
#define YESn cout<<"YES\n" 
#define NO cout<<"NO"     
#define NOn cout<<"NO\n"       

#define MORE_TESTS 0      
#define FASTIO 1     
int32_t TESTCASE_COUNT = 1, TESTCASE;

void Solve ()
{
#ifndef LOCAL
	freopen("order.in", "r", stdin);
	freopen("order.out", "w", stdout);
#endif
	int n; cin >> n;
	vector<int> v(n);
	iota(v.begin(), v.end(), 1);
	int pos = 0;
	for (int i = 1; i <= n; i ++) {
		pos += i;
		pos %= v.size();
		cout << v[pos] << " ";
		v.erase(v.begin() + pos);
		pos --;
	}
	cout << '\n';
}

/*

*/

int32_t main ()
{
    #if FASTIO == 1
    FastIO;
    #endif
    #if MORE_TESTS == 1
    cin >> TESTCASE_COUNT;
    #endif
    for (TESTCASE = 1; TESTCASE <= TESTCASE_COUNT; TESTCASE ++)
        Solve ();
}

/*
___  ___          _        ______         ___  ____ _                    _____ _         ___  ___
|  \/  |         | |       | ___ \        |  \/  (_) |                  |_   _| |        |  \/  |
| .  . | __ _  __| | ___   | |_/ /_   _   | .  . |_| |__  _ __   ___  __ _| | | |__   ___| .  . | ___   __ _  __ _  ___ _ __
| |\/| |/ _` |/ _` |/ _ \  | ___ \ | | |  | |\/| | | '_ \| '_ \ / _ \/ _` | | | '_ \ / _ \ |\/| |/ _ \ / _` |/ _` |/ _ \ '__|
| |  | | (_| | (_| |  __/  | |_/ / |_| |  | |  | | | | | | | | |  __/ (_| | | | | | |  __/ |  | | (_) | (_| | (_| |  __/ |
\_|  |_/\__,_|\__,_|\___|  \____/ \__, |  \_|  |_/_|_| |_|_| |_|\___|\__,_\_/ |_| |_|\___\_|  |_/\___/ \__, |\__, |\___|_|
                                   __/ |                                                                __/ | __/ |
                                  |___/                                                                |___/ |___/
*/