Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bfaf5a9

Browse files
2 parents ea6c2c5 + 561a03b commit bfaf5a9

File tree

9 files changed

+36
-13
lines changed

9 files changed

+36
-13
lines changed

‎.vscode/launch.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "g++-9 - Build and debug active file",
8+
"name": "g++.exe - Build and debug active file",
99
"type": "cppdbg",
1010
"request": "launch",
11-
"program": "${fileDirname}/${fileBasenameNoExtension}",
11+
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
1212
"args": [],
1313
"stopAtEntry": false,
1414
"cwd": "${workspaceFolder}",
1515
"environment": [],
1616
"externalConsole": false,
1717
"MIMode": "gdb",
18+
"miDebuggerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gdb.exe",
1819
"setupCommands": [
1920
{
2021
"description": "Enable pretty-printing for gdb",
2122
"text": "-enable-pretty-printing",
2223
"ignoreFailures": true
2324
}
2425
],
25-
"preLaunchTask": "C/C++: g++-9 build active file",
26-
"miDebuggerPath": "/usr/bin/gdb"
26+
"preLaunchTask": "C/C++: g++.exe build active file"
2727
}
2828
]
2929
}

‎.vscode/settings.json‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎.vscode/tasks.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"tasks": [
33
{
44
"type": "shell",
5-
"label": "C/C++: g++-9 build active file",
6-
"command": "/usr/bin/g++-9",
5+
"label": "C/C++: g++.exe build active file",
6+
"command": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe",
77
"args": [
88
"-g",
99
"${file}",
1010
"-o",
11-
"${fileDirname}/${fileBasenameNoExtension}"
11+
"${fileDirname}\\${fileBasenameNoExtension}.exe"
1212
],
1313
"options": {
1414
"cwd": "${workspaceFolder}"

‎CodeChef/TREE2.cpp‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
int main(){
5+
int t;
6+
cin >> t;
7+
while(t--){
8+
int n;
9+
cin >> n;
10+
vector<int> a(n);
11+
for(int i = 0; i < n; i++){
12+
cin >> a[i];
13+
}
14+
sort(a.begin(), a.end(), greater<int>());
15+
int count = 0;
16+
vector<int> ans;
17+
for(int i = 0; i < n - 1; i++){
18+
if(a[i] != a[i + 1]){
19+
ans.push_back(a[i + 1]);
20+
}
21+
}
22+
if(a[n - 1] != 0){
23+
cout << ans.size() + 1 << endl;
24+
}else{
25+
cout << ans.size() << endl;
26+
}
27+
}
28+
return 0;
29+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /