This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int n; | |
int cur[1000000]; | |
int btn[1000000]; | |
void show(void) { | |
for (int i = 0; i < n; i++) { | |
cout << cur[i] << ' '; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
int n; | |
vector<pair<int, int > > v; | |
bool compare(pair<int, int> a, pair<int, int> b) { | |
if(a.second != b.second) return a.second < b.second; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stack> | |
using namespace std; | |
stack<int> s; | |
int n, k; | |
int main(void) { | |
cin >> n >> k; | |
int coin; | |
for (int i = 0; i < n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stack> | |
using namespace std; | |
stack<int> s; | |
int n, k; | |
int main(void) { | |
cin >> n >> k; | |
int coin; | |
for (int i = 0; i < n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
long long n = 0; | |
long long ans = 0; | |
vector<long long> prime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string.h> | |
#include <algorithm> | |
using namespace std; | |
int n = 0; | |
bool isPrime[10000001]; | |
int main(void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
long long n,m; | |
long long foo(long long x, long long p) { | |
long long ret = 0; | |
long long div = p; | |
while (div <= x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
long long n,m; | |
long long foo(long long x, long long p) { | |
long long ret = 0; | |
long long div = p; | |
while (div <= x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int n; | |
int main(void) { | |
cin.tie(NULL); | |
ios::sync_with_stdio("false"); | |
cin >> n; | |
for (int i = 2; i <= n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int n, p; | |
long long ans = 1; | |
int main(void) { | |
cin.tie(NULL); | |
ios::sync_with_stdio("false"); | |
cin >> n >> p; |