This file contains hidden or 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
from collections import * | |
class Graph: | |
def __init__(self): | |
self.nodes = set() | |
self.edges = defaultdict(list) | |
self.distances = {} | |
def add_node(self, value): | |
self.nodes.add(value) |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#define LEFT -1 | |
#define RIGHT 1 | |
int main() | |
{ | |
int leftflag=1, rightflag=1, sum=0; | |
int n; | |
scanf("%d", &n); | |
int a[n]; |
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
char ps[101]; | |
char c; | |
char s[11]; | |
scanf("%[^\n]s", ps); | |
scanf(" %c", &c); | |
scanf(" %s", s); |
This file contains hidden or 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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package javaapplication2; | |
import static javaapplication2.complex.add; | |
/** |
This file contains hidden or 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
import java.awt.*; | |
import java.applet.*; | |
import java.awt.event.*; | |
import java.awt.Graphics.*; | |
import java.net.URL; | |
import java.applet.AudioClip; | |
/*<Applet code = "audioapplet.class" height="500" width="500"></Applet>*/ | |
import java.awt.event.ActionEvent; |
This file contains hidden or 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
import java.awt.*; | |
import java.awt.event.*; | |
import java.applet.*; | |
/*<Applet code="GoodMorningFrame.class" width="500" height="500"></Applet> */ | |
public class GoodMorningFrame extends Frame | |
{ | |
public GoodMorningFrame() | |
{ | |
setBackground(Color.YELLOW); |
This file contains hidden or 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
lines = [] | |
while True: | |
line = input() | |
if line: | |
lines.append(line) | |
else: | |
break | |
for i in lines[len(lines)//2:]: | |
print(i) | |
for i in lines[:len(lines)//2]: |
This file contains hidden or 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
from math import * | |
def squarefree(n): | |
for i in range(2, ceil(sqrt(n))+1): | |
if n % (i*i)== 0: | |
return False | |
return True |
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
char str[101]; | |
scanf("%[^\n]s", str); | |
int num=0, max=0, occ=1; | |
int l = strlen(str); | |
for(int i=0; i<l; i++) |