Codeforces A. Add Candies (#683 Div.2 by Meet IT) (思維 / 水題)
題意: 有n包糖果,第i包裡有i顆,目標是要讓所有糖包裡的糖果一樣多。可進行m次操作,第j次操作將j顆糖果新增在所選糖包外的糖包裡。輸出操作次數及每次操作的a[j]。
思路: 直接輸出1到n即可。
程式碼實現:
#include<bits/stdc++.h>
#define endl '\n'
#define null NULL
#define ll long long
#define int long long
#define pii pair<int, int>
#define lowbit(x) (x &(-x))
#define ls(x) x<<1
#define rs(x) (x<<1+1)
#define me(ar) memset(ar, 0, sizeof ar)
#define mem(ar,num) memset(ar, num, sizeof ar)
#define rp(i, n) for(int i = 0, i < n; i ++)
#define rep(i, a, n) for(int i = a; i <= n; i ++)
#define pre(i, n, a) for(int i = n; i >= a; i --)
#define IOS ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
const int way[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
using namespace std;
const int inf = 0x7fffffff;
const double PI = acos(-1.0);
const double eps = 1e-6;
const ll mod = 1e9 + 7;
const int N = 2e5 + 5;
int t, n;
signed main()
{
IOS;
cin >> t;
while(t --){
cin >> n;
for(int i = 1; i <= n; i ++) cout << i << " ";
cout << endl;
}
return 0;
}
相關文章
- Codeforces Round 942 Div.2 題解
- Codeforces Round 960 (Div.2) 補題
- Codeforces Round 957 (Div.2)(A-D題解)
- Codeforces Round 689(Div.2) E題 Water Level
- Codeforces Round #953 (Div.2)
- Codeforces Round #469 C A. Zebras
- Codeforces Round 992 (div.2) F
- CodeForces - 1430D String Deletion (思維)
- CodeForces - 976A:Minimum Binary Number(水題)
- Codeforces Beta Round #76 (Div. 1 Only) A. Frames
- 【CodeForces】 Codeforces Round #672 (Div. 2) B.Rock and Lever (思維&位運算)
- C. Lose it!(思維)Codeforces Round #565 (Div. 3)
- C. Dominant Piranha(思維) Codeforces Round #677 (Div. 3)NaN
- Codeforces Round #688 (Div. 2) C. Triangles(思維,數學)
- Codeforces-Round#548(Div.2)-C-Edgy Trees-快速冪
- Codeforces Round 944 (Div. 4) G(思維 + 位運算性質)
- 組合計數思維題
- 好玩的木樁(思維題)
- 思維題專項訓練
- 24.2.13 ~ 4.13 Codeforces Round 925 & 926 & 934 & 939 (Div.3 / Div.2 * 3)
- 思維體系---技術思維、業務資料思維、產品思維、複合思維
- cluster meet
- Find the Maximum - 題解【思維,貪心】
- 淺析工具思維、產品思維、品牌思維與定位
- [AtCoder] E - Putting Candies
- 求職思維和招聘思維求職
- 火題大戰Vol.1 A.
- # 火題小戰 A.玩個球
- 測試筆試邏輯思維題筆試
- CF538B Quasi Binary 思維題
- 怎麼凸顯主題?極思維
- AtCoder Beginner Contest 中的小思維題
- 把流量思維變成留量思維
- zcmu——2014: 一生之敵(思維題)
- 框架思維框架
- 極思維
- 黑客思維黑客
- acm-(思維、奇偶性、矩陣)Codeforces Round #682 (Div. 2) C. Engineer ArtemACM矩陣