Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; ifstream cin("bomber.in"); ofstream cout("bomber.out"); int n , I; struct bomba{ int x, y, p; bool explodat = false; void citire() { cin>>x>>y>>p; } }v[10001]; int distP(int a, int b) { int x = v[a].x - v[b].x; int y = v[a].y - v[b].y; return (x*x + y*y); } void explode(int poz) { v[poz].explodat = true; for(int i = 1;i<=n;i++) { if(!v[i].explodat) { if(distP(poz,i) <= v[poz].p*v[poz].p) explode(i); } } } int main() { cin>>n>>I; for(int i = 1;i<=n;i++) v[i].citire(); explode(I); int cnt = 0; for(int i = 1;i<=n;i++) if(!v[i].explodat) cnt++; cout << cnt; return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)