Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Perfect Square Solution
#include <bits/stdc++.h> using namespace std; #define f(i,n) for(int i = 0; i < n; i++) #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define vii vector<pii> #define vll vector<pll> #define vvi vector<vi> #define vvl vector<vl> #define inf INT_MAX #define llinf LONG_LONG_MAX #define F first #define S second #define pb push_back #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); void solve() { set<int> a; int n = 1000; for(int i = 1; i < n; i++) { a.insert(i*i); } for(auto x: a) { for(auto y: a) { if((a.find(x + 5*y) != a.end()) && (a.find(x - 5*y) != a.end())) { cout << x << "/" << y << "\n"; } } } } signed main() { fast; int t; cin >> t; while(t--) { solve(); } return 0; }
run
|
edit
|
history
|
help
0
fb_series
Ultimo intento
10 Wizards-DP
Minimum Vertices to Traverse Directed Graph
156
Polimorfizm :)
pointconcat
matrix
begin_end.cpp
HeapSort